This works and shows a plot in vscode
:
#%% cell with plot
import matplotlib.pyplot as plt
y = [3.2, 3.9, 3.7, 3.5, 3.02199]
x = [0.15, 0.3, 0.45, 0.6, 0.75]
n = [155, "outliner", 293, 230, 670]fig, ax = plt.subplots()
ax.scatter(x, y)
plt.xlabel('the x axis')
plt.ylabel('the y axis')
for i, txt in enumerate(n):ax.annotate(txt, (x[i], y[i]))plt.show()
Here is the image:
However, this does not work:
#%% call plot separately
plt.show()
And neither does this:
#%% try this too
plt
So given that the plot exists (because it can be seen) in the first cell, why can it not be called or seen in the other cells or how can one do this ?