Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import matplotlib.pyplot as plt
import cPickle as pickle
def main():
fig, ax = plt.subplots()
ax.plot(range(10)), range(10))
fig2 = copy_figure(fig)
fig2.axes[0].plot(range(10)[::-1], color='red')
def copy_figure(fig):
return pickle.loads(pickle.dumps(fig, pickle.HIGHEST_PROTOCOL))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.