-
Notifications
You must be signed in to change notification settings - Fork 5
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
Differences with show() between backends #1
Comments
I fixed the doc typos. I suspect the issues with show are all due to the fact that For Qt this is https://github.com/matplotlib/matplotlib/blob/a35921c407aced5e65d39b29fd942676ee03679b/lib/matplotlib/backends/backend_qt.py#L402-L412 vs https://github.com/matplotlib/matplotlib/blob/a35921c407aced5e65d39b29fd942676ee03679b/lib/matplotlib/backends/backend_qt.py#L1023-L1026 In main difference is in the The reason mpl-gui is not using At least with Qt you can produce a version of this behavior with just Matplotlib via import matplotlib.pyplot as plt
plt.figure()
plt.figure()
plt.pause(50)
# manually close the windows After 50s you will get the prompt back. The "simple" fix for now is to put is logic to try running |
Having show block with no timeout on tk is currently broken because the mpl tk backend relies on grabbing the first manager from |
I think I have this working consistently from {qt5, qt6, gtk3, gtk4, tk}. I do not have easy access to a mac with a dev environment set up and could not get wx to install easily. These is now a |
First pop-up:
Traceback (most recent call last):
File "mpl-gui/UAT.py", line 52, in <module>
mg.show([fig1, fig2])
File "mpl-gui/mpl_gui/__init__.py", line 71, in show
managers.append(promote_figure(fig))
File "mpl-gui/mpl_gui/_promotion.py", line 60, in promote_figure
manager = _backend_mod.new_figure_manager_given_figure(next(_figure_count), fig)
File "matplotlib/lib/matplotlib/backends/backend_wx.py", line 1373, in new_figure_manager_given_figure
frame = FigureFrameWx(num, figure, canvas_class=cls.FigureCanvas)
File "matplotlib/lib/matplotlib/backends/backend_wx.py", line 886, in __init__
super().__init__(parent=None, id=-1, pos=pos)
wx._core.PyNoAppError: The wx.App object must be created first! One more general thing unrelated to mpl-gui would be that I found |
I was just testing out the examples from the docs and figured I would put some quick findings here while running on a Mac.
subplot_module
tosubplot_mosaic
in a couple of places in the code samplesqt5agg
: mg.show() does not exit after closing both figures, the event loop keeps runningmacosx
: mg.show() closing one figure closes all of the figures, as if the closeWindow gets sent to every figure, not just the one clicked.tkagg
: In the secondfr.show()
call in the examples I get this error:_tkinter.TclError: can't invoke "wm" command: application has been destroyed
(macosx seems to get through this and the qt5agg I don't think ever even gets here due to the event loop not quiting after the first show() as mentioned above)The text was updated successfully, but these errors were encountered: