@@ -232,21 +232,19 @@ def plot_matplotlib(self, data_plot, **backend_kwargs):
232232
233233 dp = to_attr (data_plot )
234234
235- assert backend_kwargs ["axes" ] is None , "axes argument is not allowed in MotionWidget "
235+ assert backend_kwargs ["axes" ] is None , "axes argument is not allowed in DriftRasterMapWidget. Use ax instead. "
236236
237237 self .figure , self .axes , self .ax = make_mpl_figure (** backend_kwargs )
238- fig = self .figure
239238
240239 if dp .times is None :
241- x = dp .peaks ["sample_index" ] / dp .sampling_frequency
240+ peak_times = dp .peaks ["sample_index" ] / dp .sampling_frequency
242241 else :
243- x = dp .times [dp .peaks ["sample_index" ]]
242+ peak_times = dp .times [dp .peaks ["sample_index" ]]
244243
245- y = dp .peak_locations [dp .direction ]
244+ peak_locs = dp .peak_locations [dp .direction ]
246245 if dp .scatter_decimate is not None :
247- x = x [:: dp .scatter_decimate ]
248- y = y [:: dp .scatter_decimate ]
249- y2 = y2 [:: dp .scatter_decimate ]
246+ peak_times = peak_times [:: dp .scatter_decimate ]
247+ peak_locs = peak_locs [:: dp .scatter_decimate ]
250248
251249 if dp .color_amplitude :
252250 amps = dp .peak_amplitudes
@@ -271,7 +269,7 @@ def plot_matplotlib(self, data_plot, **backend_kwargs):
271269 else :
272270 color_kwargs = dict (color = dp .color , c = None , alpha = dp .alpha )
273271
274- self .ax .scatter (x , y , s = 1 , ** color_kwargs )
272+ self .ax .scatter (peak_times , peak_locs , s = 1 , ** color_kwargs )
275273 if dp .depth_lim is not None :
276274 self .ax .set_ylim (* dp .depth_lim )
277275 self .ax .set_title ("Peak depth" )
0 commit comments