You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ubuntu Linux 10.04, matplotlib version: 0.99.1.1, backend GtkAgg;
probably the same in all later versions
There seems to be no way of protecting a GUI-only figure containing
matplotlib widgets. If this figure becomes active, any pyplot command
will draw over the widgets. As an example, this happens in the built-in
subplot_tool function where the plot command draws into the Reset box:
$ ipython -pylab
In [1]: subplot_tool()
# click any slider
In [2]: plot(range(2))
MATLAB deals with this issue by having a HandleVisibility and IntegerHandle
properties, which prevent a GUI figure from becoming the active one and protect
it from accidental changes. It would be surely useful to have some similar
option of protecting GUI figures in matplotlib.
Could you please be more specific and provide an example of creating protected figure?
Is there some way of setting figure protection after subplot_tool() creates its window?
This seems to have been fixed since at least 2.0, as calling subplot_tool opens a (empty) figure which becomes active instead of it, so nothing is drawn on the Reset button.
Activity
tacaswell commentedon Jan 16, 2014
Should be addressed in the #2624 or #2736 work. The simplest fix is a way to exclude/remove a figure from
gcf_helper.pavoljuhas commentedon Jan 17, 2014
Could you please be more specific and provide an example of creating protected figure?
Is there some way of setting figure protection after subplot_tool() creates its window?
tacaswell commentedon Jan 17, 2014
Sorry, that comment is mostly a note to my self to make linkages from those issues to this one.
By 'should' here I mean 'remember to make it able to do this'.
The safest way is to use the OO interface, not pyplot, that way you never are surprised about where it plots.
petehuang commentedon Jan 6, 2017
#2624 linked to MEP27/#4143, just tossing a link here.
QuLogic commentedon Apr 22, 2020
This seems to have been fixed since at least 2.0, as calling
subplot_toolopens a (empty) figure which becomes active instead of it, so nothing is drawn on the Reset button.