Open glemaitre opened 22 hours ago
I'm wondering if this is something expected?
:joy: :sweat_smile:
thanks for reporting I'll look into it
@glemaitre so it seems using matplotlib.rc_context
anywhere is enough to prevent the display of figures in a notebook. here is a reproducer without skrub could you check if it has the same effect for you?
import matplotlib
from matplotlib import pyplot as plt
with matplotlib.rc_context():
plt.close(plt.figure())
# %%
plt.plot([1, 2], [1, 2])
matplotlib issue: https://github.com/matplotlib/matplotlib/issues/25041
also reported here: https://github.com/matplotlib/matplotlib/issues/26716
Interesting. At least there is a work around.
the matplotlib context manager does not seem to do anything more complex than updating matplotlib.rcParams
so we can do it ourselves, and by updating only the key we need it seems to fix the issue: #1172
let me know if it works on your side :)
Given the following code blocks:
We expect (in a notebook or vs code) that running those cell will end-up showing the report and the histogram plot. However, the later cell requires a
plt.show()
to show the plot. This is not the behaviour when not patching the display.Also it seems that if we intend a first plot, then the interaction with matplotlib does not happen:
I'm wondering if this is something expected?