@@ -934,7 +934,7 @@ def update_plots(self):
934934 if shot not in self .plot_items [channel ]:
935935 # plot_item = self.plot_widgets[channel].plot(shot.traces[channel][0], shot.traces[channel][1], pen=pg.mkPen(QColor(colour), width=2))
936936 # Add empty plot as it the custom resampling we do will happen quicker if we don't attempt to first plot all of the data
937- plot_item = self .plot_widgets [channel ].plot ([0 , 0 ], [0 ], pen = pg .mkPen (QColor (colour ), width = 2 ), stepMode = True )
937+ plot_item = self .plot_widgets [channel ].plot ([0 , 0 ], [0 ], pen = pg .mkPen (QColor (colour ), width = 2 ), stepMode = 'center' )
938938 self .plot_items [channel ][shot ] = plot_item
939939
940940 # Add Shutter Markers of newly ticked Shots
@@ -979,7 +979,7 @@ def create_plot(self, channel, ticked_shots):
979979 if channel in shot .traces :
980980 # plot_item = self.plot_widgets[channel].plot(shot.traces[channel][0], shot.traces[channel][1], pen=pg.mkPen(QColor(colour), width=2))
981981 # Add empty plot as it the custom resampling we do will happen quicker if we don't attempt to first plot all of the data
982- plot_item = self .plot_widgets [channel ].plot ([0 , 0 ], [0 ], pen = pg .mkPen (QColor (colour ), width = 2 ), stepMode = True )
982+ plot_item = self .plot_widgets [channel ].plot ([0 , 0 ], [0 ], pen = pg .mkPen (QColor (colour ), width = 2 ), stepMode = 'center' )
983983 self .plot_items [channel ][shot ] = plot_item
984984
985985 if len (shot .traces [channel ]) == 3 :
@@ -1106,7 +1106,7 @@ def __resample4(self, x_in, y_in, x_out, y_out, stop_time):
11061106 # i += 1
11071107
11081108 # Get values until we get to the end of the data:
1109- while j < len (x_in ) and i < len (x_out ) - 2 : # Leave one spare for the final data point and one because stepMode=True requires len(y)=len(x)-1
1109+ while j < len (x_in ) and i < len (x_out ) - 2 : # Leave one spare for the final data point and one because stepMode='center' requires len(y)=len(x)-1
11101110 # This is 'nearest neighbour on the left' interpolation. It's
11111111 # what we want if none of the source values checked in the
11121112 # upcoming loop are used:
@@ -1264,7 +1264,7 @@ def __pool_resample(self, channel, shot, colour, xmin, xmax, dx):
12641264 xnew , ynew = self .resample (shot .scaled_times (channel ), shot .traces [channel ][1 ], xmin , xmax , shot .stop_time , dx )
12651265 else :
12661266 xnew , ynew = self .resample (shot .traces [channel ][0 ], shot .traces [channel ][1 ], xmin , xmax , shot .stop_time , dx )
1267- return inmain_later (self .plot_items [channel ][shot ].setData , xnew , ynew , pen = pg .mkPen (QColor (colour ), width = 2 ), stepMode = True )
1267+ return inmain_later (self .plot_items [channel ][shot ].setData , xnew , ynew , pen = pg .mkPen (QColor (colour ), width = 2 ), stepMode = 'center' )
12681268 except Exception :
12691269 #self._resample = True
12701270 pass
0 commit comments