MyST-NB icon indicating copy to clipboard operation
MyST-NB copied to clipboard

myst-nb does not honnor the pyplot "off" interactive mode

Open 12rambau opened this issue 1 year ago • 0 comments

Describe the bug

context In my documentation I need to specifically explain how tyo design the Figure and Axes object so I split the creation of the subplots from the other cells. To avoid to see an empty figure being display after my cell I activate the ioff mode of pyplot.

expectation I expect the behaviour of mystnb to be consistent with the behaviour of the notebook in jupyter, collab and visual studio code i.e. to not display the empty graph as it's not yyest populated.

bug When the doc is build the grah apears anyway:

image

Reproduce the bug

execute the following cell in Jupyter and then in a Sphinx documentation:

from matplotlib import pyplot as plt 

plt.ioff() # remove interactive for the sake of the example
fig, ax = plt.subplots()

12rambau avatar Oct 13 '24 13:10 12rambau