In the Spyder IDE, I want to keep the inline console plotting (I don't want separate windows to spawn for each plot), but I want to programmatically disable plotting, i.e. in different cells.
In my workflow I need to plot a few simple graphs, and then generate figures and save them as video frames (many thousands). My frames are created by loading a jpg image, and then overlaying some annotation i.e.;
for jpg_path in path_list:
img = mpl.image.imread(jpg_path)
ax.imshow(img)
ax.text(etc...)
fig.savefig(etc...)
I want to keep the inline backend; %matplotlib inline
.
But turn off plotting with something like plt.ioff()
.
But plt.ioff()
only works with i.e. %matplotlib qt
backend, not inline
!
I've had several cases where I forget to change to %matplotlib qt
(because it's not a python command and I have to enter it into the console seperately) and then plt.ioff()
- resulting in 10000 images being posted in the console, freezing my machine.