I have multiple plots created as below.
fig, ax = plt.subplots()
ax.plot(x,y)
fig2, ax2 = plt.subplots()
ax2.plot(x2,y2)
fig3, ax3 = plt.subplots()
ax3.plot(x3,y3)
This creates three figures, x, x2, x3 are time range. I want to make the xlim on all this plots equal to each other, so that when I zoom or pan in one graph it automatically update and show the same x (time) range in all.
One graph can act as master as well if this is not possible.
Currently I use this function in script (Jupyter) which I have to run after every interaction.
def syncplot():
xlimax1=ax1.get_xlim()
ax2.set_xlim(xlimax1[0],xlimax1[1])
ax3.set_xlim(xlimax1[0],xlimax1[1])
syncplot()