I have my data organized into a multiindex dataframe. Ex:
Sweep Time Primary Secondary x720nm x473nm PMTShutter
Sweep0001 0.00000 -87.429810 -4.882812 0.000610 0.000305 0.000000
0.00005 -87.445068 -4.882812 0.000610 0.001221 0.000000
0.00010 -87.451172 -4.272460 0.000000 0.000916 0.000000
... ... ... ... ...
Sweep0039 0.68655 -87.261963 -4.272461 0.000305 0.000916 0.000305
0.68660 -87.258911 -4.272461 0.000305 0.000916 0.000305
0.68665 -87.252808 -5.493164 0.000000 0.000916 0.000305
0.68670 -87.261963 -4.272461 0.000305 0.000916 0.000305
Plotting any single sweep works fine, but when I go to plot multiple sweeps I have these artifacts that are basically straight lines (see below).
This is not specific to matplotlib, as it also happens with pyqtgraph.
Issue not present when plotting a single trace:
plt.plot(data.Time['Sweep0001'], data.Primary['Sweep0001'])

Issue present once plotting multiple traces:
plt.plot(data.Time['Sweep0001':'Sweep0002'], data.Primary['Sweep0001':'Sweep0002'])

plt.plot(data.Time['Sweep00-1':'Sweep0010'], data.Primary['Sweep0001':'Sweep0010'])

Timeat all.