You can saw a shape to a disk like this
import matplotlib.pyplot as plt
import numpy as np
import pickle
fig_object = plt.figure()
x = np.linspace(0,3*np.pi)
y = np.sin(x)
plt.plot(x,y)
pickle.dump(fig_object,file('sinus.pickle','w'))
And then load it from the disk and onto the screen:
fig_object = pickle.load(open('sinus.pickle','rb'))
fig_object.show()
source
share