I am using jupyter and jupyter lab to analyze data.
In case of showing graph, I want to show all of graph in the last cell.
But jupyter and jupyter lab show graph right after setting plot code like
plt.scatter(regdata[0],regdata[1])
What I want to do is setting plots in above different cells and showing in the last cell.
This is a duplicate of how to reuse plot in a next jupyter cell.
To summarise, you can just call the figure again in a later cell.
First cell
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
x = np.arange(0, 10)
y = x**2
fig, ax = plt.subplots()
ax.plot(x, y)
plt.close() # close figure to stop it showing in this cell.
To display this figure in a later cell you can just call the figure again:
Second cell
fig
This will display the figure
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With