The problem I have can be described as follows: Two different datasets with two different x and y axes (lets call them t1,y1,t2, and y2), t1 and t2 can be the same.
What I need to do is to overlay/plot both plots together (i.e, not in subplots, or in subplots that are the same size and exactly overlap one another) and be able to scroll each axis independently. My goal is to be able to visually line them up to I can compare them.
What I have until not is the following:
import numpy as np from matplotlib import pyplot as plt from matplotlib.widgets import Slider dArray = np.genfromtxt("t5_24.csv",delimiter=','); y1 = dArray[:,2]; y2 = dArray[:,3]; fig, ax = plt.subplots() plt.subplots_adjust(bottom=0.25) t = np.linspace(0,len(temp1),len(temp1)) p1 = plt.plot(t,y1,t,y2) axcolor = 'lightgoldenrodyellow' axpos = plt.axes([0.2, 0.1, 0.65, 0.03], axisbg=axcolor) spos = Slider(axpos, 'Pos', 0.1, len(t)) def update(val): pos = spos.val # ax.xlim(pos,pos+30*60) ax.axis([pos,pos+120*60,0,500]) fig.canvas.draw_idle() spos.on_changed(update) plt.show() which was taken from this stackoverflow post
Essentially what I need to do (I think) is to have two axes, completely overlapping, and with two scrollbars, on the same figure.
Any help is greatly appreciated.
Sorry for any English mistakes, ESL
