Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protecting figure with matplotlib widgets #984

Closed
pavoljuhas opened this issue Jul 2, 2012 · 5 comments
Closed

protecting figure with matplotlib widgets #984

pavoljuhas opened this issue Jul 2, 2012 · 5 comments
Assignees

Comments

@pavoljuhas
Copy link
Contributor

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.

@ghost ghost assigned pelson Aug 19, 2012
@tacaswell
Copy link
Member

Should be addressed in the #2624 or #2736 work. The simplest fix is a way to exclude/remove a figure from gcf_helper.

@pavoljuhas
Copy link
Contributor Author

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
Copy link
Member

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
Copy link
Contributor

#2624 linked to MEP27/#4143, just tossing a link here.

@tacaswell tacaswell modified the milestones: 2.1 (next point release), 2.2 (next next feature release) Sep 24, 2017
@QuLogic
Copy link
Member

QuLogic commented Apr 22, 2020

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.

@QuLogic QuLogic closed this as completed Apr 22, 2020
@story645 story645 removed this from the future releases milestone Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants