I want to do the following in a Jupyter Notebook:
- Create a
pyplot.figure
in a cell;
- For each subsequent cells, calculate values and plot them to that same figure without displaying anything;
- At the end, in another cell, display the figure with the result of every previous plot command.
Currently, while using %matplotlib notebook
, the figure is always displayed after the same cell it's been created, and I don't even call plt.show()
.
This is not the behavior I desire. Instead I would like to postpone the display of the figure for the last cell only, but the figure of course should contain the results of the sequential plot commands called in the cells in between.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…