Open
Description
Bug summary
This is arguably a very weird bug, but it is easy to reproduce. I don't know if the problem is in mpl or jupyterlab.
When using the bit of code below in a notebook, the plot shows once (and only once). Calling the function again prevents the plot to show again (see video).
I am at loss as to why this would happen 😅 . This didn't happen before, but I have no clue as to whether an update to mpl or jupyterlab created the issue.
Code for reproduction
import matplotlib as mpl
import matplotlib.pyplot as plt
figsize=(3, 3)
def plotter():
with mpl.rc_context({"figure.figsize": figsize}):
plt.plot([1, 2, 3])
And then:
plotter()
Actual outcome
mpl-2023-01-20_17.34.46.mp4
Expected outcome
The plot should show up on the second call.
Additional information
No response
Operating system
Linux
Matplotlib Version
3.6.3
Matplotlib Backend
module://matplotlib_inline.backend_inline
Python version
3.10
Jupyter version
3.5.2
Installation
None