Hello,
I am wondering if it is possible to reuse an axes from one figure in another figure.
Consider the following case:
First generate a figure with three axes:
import matplotlib.pyplot as plt
fig, (ax1,ax2,ax3) = plt.subplots(3,1)
Then add, e.g., plot, title, etc to ax1
and save the figure:
ax1.plot(...)
ax1.set(...)
fig.savefig(...)
Now I would like to generate a second figure showing all the things done to ax1
.
I tried the following:
figNEW, axNEW = plt.subplots()
axNEW=ax1
figNEW.savefig(...)
But this is not working (the saved figure is showing only an empty graph).
So, is it in principle possible to share axes? How should I do this?
Many thanks in advance!