Open orome opened 2 years ago
@orome I believe this is something to do with the changes about when draws happen - I think between 0.8
and 0.9
. The new behavior has several advantages in terms of plot persistence, but may (i'm not totally sure) be causing your problem.
Happily I think the fix is very simple. In your binder link if I add fig.canvas.draw()
as the last line of plot_logisitic
then it seems to work as intended. This issue aside I'd generally recommend explicit draws like this as best practice, before you were relying on a draw being triggered by something else which doesn't come with any garuntees
See additional troubleshooting attempts here. (Using older versions of the software that still are available in MyBInder launches from Gesis was a different tack.)
Has something about Jupyter Lab, ipywidgets, or ipympl changed recently that might be causing this?
im pretty sure the specific difference between old and newer versions is this function: https://github.com/matplotlib/ipympl/pull/343/files#diff-4979a0b66cf007ec0278c825c5c82b71fdf56711069626bb0ffa5f3c4cc9412bR380
interestingly calling plt.ion()
also fixes things, even though plt.isinteractive()
returns True. That smells a bit like a bug somewhere
more specifically even though plt.isinteractive
returns True
the repl_display_hook
doesn't seem to have been installed which may be due to the newer delayed backend selection in pyplot? So you can even just call plt.install_repl_displayhook()
and get back the old behavior.
@tacaswell is it a bug that: plt.isinteractive()
returns True
even though the displayhook is not installed? That is there seems to be a partially completed interactive state at the start which you can then escape with plt.ion
, but never return to.
oh wow - I should've looked deeper. I think that the answer to my question is: yes it is a bug, but it was fixed 23 days ago: https://github.com/matplotlib/matplotlib/pull/23057
@orome I'll bet that if you go to an older mpl version the old way will work again
@ianhi Just to be sure I've got it: there is indeed a bug, but adding an explicit fig.canvas.draw()
will fix it and is something I should be doing anyway, right?
@orome yup!
there is indeed a bug
I think the bug is in matplotlib 3.5.1 and 3.5.2 but will be fixed in 3.5.3+
but adding an explicit fig.canvas.draw() https://github.com/matplotlib/ipympl/issues/469#issuecomment-1151558213, right?
yes and yes
Describe the issue
I have consistently used the following workflow for fully updating my Jupyter Lab working environments:
Recently however, after these steps:
Projects in virtualenvs that have not been recently updated in this way continue to work fine, and updating them reliably makes them stop working.
This occurs consistently (I have now ruined half a dozen projects confirming the pattern), and even for notebooks hosted outside my local machine (such as this one hosted on Binder). Control widgets themselves seem to work fine though (e.g., in notebooks like this one) when ipympl is not involved. I have also confirmed that the observed behavior is independent of browser and local machine (at least macOS vs iOS).
Has something about Jupyter Lab, ipywidgets, or ipympl changed recently that might be causing this?
Typical post update configuration:
Typical pre update configuration:
Typical requirements:
(I've tried omitting Kite to see if that was the culprit. In any case it is not present in the Binder versions.)
Versions