-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: Figures fail to redraw with IPython #23042
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
Comments
On the bright side, there is a very easy fix, an explicit call to I suspect that this is more fallout from deferring actually loading the backend until it is actually needed. |
@ahesford Thank you for reporting this and sorry we broke this. Please forgive my last message if it came across as too terse. |
No worries. I'm glad there's a simple workaround. In the meantime, I reverted the version shipped in Void pending a release with a permanent fix. |
I'm not really sure how the backend solution works with the |
I can confirm that |
This is something that has historically been done by IPython (it is a side effect of There is something going wrong in the (brittle) dance between IPython and Matplotlib. Given that it is as change on the mpl side that broke this I assume it it our fault and can (and should) fix it, but we still need to sort out why which will likely require chasing through the code on both sides. It is complicated because both side have extensive "work with old versions of the other" code. Related, I observed in some cases at NSLS-II that if we had |
I am also experiencing this, and It would be nice if this line was not necessary as I will have to update all of my notebooks! |
closes matplotlib#23042 In matplotlib#22005 we change `pyplot` so that at import time we do not force a switch of the backend and install the repl displayhook. However, this meant that in some cases (primarily through `ipython --pylab`) to end up with a session where `install_repl_displayhook` had never been called.
closes matplotlib#23042 In matplotlib#22005 we change `pyplot` so that at import time we do not force a switch of the backend and install the repl displayhook. However, this meant that in some cases (primarily through `ipython --pylab`) to end up with a session where `install_repl_displayhook` had never been called.
closes matplotlib#23042 In matplotlib#22005 we change `pyplot` so that at import time we do not force a switch of the backend and install the repl displayhook. However, this meant that in some cases (primarily through `ipython --pylab`) to end up with a session where `install_repl_displayhook` had never been called.
closes matplotlib#23042 In matplotlib#22005 we change `pyplot` so that at import time we do not force a switch of the backend and install the repl displayhook. However, this meant that in some cases (primarily through `ipython --pylab`) to end up with a session where `install_repl_displayhook` had never been called. Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
closes matplotlib#23042 In matplotlib#22005 we change `pyplot` so that at import time we do not force a switch of the backend and install the repl displayhook. However, this meant that in some cases (primarily through `ipython --pylab`) to end up with a session where `install_repl_displayhook` had never been called. Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Bug summary
A regression between release versions 3.5.1 and 3.5.2 causes figures to fail to redraw after an initial plot is added using the
pyplot
interface in an interactive IPython session. This has been observed with bothpyplot.plot
andpyplot.tripcolor
. The figure will show the first plot drawn, but subsequent calls topyplot.plot
andpyplot.tripcolor
fail to update an on-screen figure untilpyplot.draw
is invoked. This has been observed with IPython versions 8.3.0 (current) and 8.2.0.Both the Qt5 and Tk backends exhibit the same issues.
Code for reproduction
Actual outcome
plot
command, a figure appears with ay = x
line shown.plot
command, the figure does not update.draw
command, the figure updates to show both they = x
andy = -x
lines.Expected outcome
plot
command, a figure appears with ay = x
line shown. (This is as expected.)plot
command, the figure updates with the addition of ay = -x
line. (This is the deviation.)draw
command should produce no visible change in the figure.Additional information
This regression has been bisected to commit f937b0a.
The testbed is a current Void Linux system running Python 3.10.4, including the system
python3-tkinter
package for a GUI. (As noted above, this bug is also present with the Qt5 backend.) All packages were installed in a virtual environment. The output ofpip freeze
is:(Note that the funny
matplotlib
version comes from a local git repo checked out to the problematic commit.)Operating system
Void Linux x86_64
Matplotlib Version
3.5.2
Matplotlib Backend
TkAgg, Qt5Agg
Python version
3.10.4
Jupyter version
None
Installation
pip
The text was updated successfully, but these errors were encountered: