I was looking at matplotlib python inline on/off and this kind of solves the problem but when I do plt.ion()
all of the Figures pop up (100s of figures). I want to keep them suppressed in a single cell. Is there a with
loop I can use to turn off %matplotlib inline
or is this impossible?
How to suppress matplotlib inline for a single cell in Jupyter Notebooks/Lab?
Asked Answered
Figures closed before the end of the cell will not be shown. Calling plt.close("all")
at the end of the cell will close all figures and none will be displayed in the cell's output.
© 2022 - 2024 — McMap. All rights reserved.
plt.ion()
in a jupyter cell? To suppress any output from a jupyter cell use%%capture
as the first line of that cell. Is that what you mean? – Manganate%%capture
can suppress all output from a Jupyter cell? I didn't know that. I will take another look at the magic lines. Thank you. That will be a good fix for what I'm looking for atm. Ideally, I would only want to turn off the plotting because I usually write to stdout at certain checkpoints but I could do without that in the meantime. Ideally I would want something likewith %matplotlib inline == False: [code]
. However, I realize that I completely butchered the syntax for thewith
statement, themagic
, and the use of aboolean
but I'm not sure if there's something similar. – Excurvature%%capture
ever worked for me (hence my answer there). – Manganatewithout inline do:
? Else you should probably clearly state in how far this question is different from the other one, explaining why none of the four solutions are not working for you. – Manganate%%capture
was the only approach that worked for you. Thanks! – Excurvature%matplotlib agg
would work as well. Did you try that? – Manganate