-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Dedupe implementations of configure_subplots(). #16818
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1453,19 +1453,19 @@ def subplot_tool(targetfig=None): | |
""" | ||
Launch a subplot tool window for a figure. | ||
|
||
A :class:`matplotlib.widgets.SubplotTool` instance is returned. | ||
A `matplotlib.widgets.SubplotTool` instance is returned. | ||
""" | ||
if targetfig is None: | ||
targetfig = gcf() | ||
|
||
with rc_context({'toolbar': 'None'}): # No nav toolbar for the toolfig. | ||
toolfig = figure(figsize=(6, 3)) | ||
toolfig.subplots_adjust(top=0.9) | ||
|
||
if hasattr(targetfig.canvas, "manager"): # Restore the current figure. | ||
_pylab_helpers.Gcf.set_active(targetfig.canvas.manager) | ||
|
||
return SubplotTool(targetfig, toolfig) | ||
with rc_context({"toolbar": "none"}): # No navbar for the toolfig. | ||
# Use new_figure_manager() instead of figure() so that the figure | ||
# doesn't get registered with pyplot. | ||
timhoffm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
manager = new_figure_manager(-1, (6, 3)) | ||
manager.set_window_title("Subplot configuration tool") | ||
tool_fig = manager.canvas.figure | ||
tool_fig.subplots_adjust(top=0.9) | ||
manager.show() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The work around there is to put the show on a 0s timer on the event loop. That will make it show as soon as the event loop is allowed to run again (which is either on return of control to the user or when There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do you want to put in that patch? given that you seem to know what to do... |
||
return SubplotTool(targetfig, tool_fig) | ||
|
||
|
||
# After deprecation elapses, this can be autogenerated by boilerplate.py. | ||
|
Uh oh!
There was an error while loading. Please reload this page.