##// END OF EJS Templates
Fix events for non colormaps plots
jespinoza -
r1091:0433527a0a47
parent child
Show More
@@ -88,7 +88,7 class PlotData(Operation, Process):
88 self.colorbar = kwargs.get('colorbar', True)
88 self.colorbar = kwargs.get('colorbar', True)
89 self.factors = kwargs.get('factors', [1, 1, 1, 1, 1, 1, 1, 1])
89 self.factors = kwargs.get('factors', [1, 1, 1, 1, 1, 1, 1, 1])
90 self.titles = ['' for __ in range(16)]
90 self.titles = ['' for __ in range(16)]
91
91
92 def __fmtTime(self, x, pos):
92 def __fmtTime(self, x, pos):
93 '''
93 '''
94 '''
94 '''
@@ -200,7 +200,7 class PlotData(Operation, Process):
200 Event for scrolling, scale figure
200 Event for scrolling, scale figure
201 '''
201 '''
202 cb_ax = event.inaxes
202 cb_ax = event.inaxes
203 if cb_ax in [ax.cbar.ax for ax in self.axes]:
203 if cb_ax in [ax.cbar.ax for ax in self.axes if ax.cbar]:
204 ax = [ax for ax in self.axes if cb_ax == ax.cbar.ax][0]
204 ax = [ax for ax in self.axes if cb_ax == ax.cbar.ax][0]
205 pt = ax.cbar.ax.bbox.get_points()[:,1]
205 pt = ax.cbar.ax.bbox.get_points()[:,1]
206 nrm = ax.cbar.norm
206 nrm = ax.cbar.norm
@@ -221,7 +221,7 class PlotData(Operation, Process):
221 if cb_ax is None:
221 if cb_ax is None:
222 return
222 return
223
223
224 if cb_ax in [ax.cbar.ax for ax in self.axes]:
224 if cb_ax in [ax.cbar.ax for ax in self.axes if ax.cbar]:
225 cb_ax.press = event.x, event.y
225 cb_ax.press = event.x, event.y
226 else:
226 else:
227 cb_ax.press = None
227 cb_ax.press = None
@@ -233,7 +233,7 class PlotData(Operation, Process):
233 cb_ax = event.inaxes
233 cb_ax = event.inaxes
234 if cb_ax is None:
234 if cb_ax is None:
235 return
235 return
236 if cb_ax not in [ax.cbar.ax for ax in self.axes]:
236 if cb_ax not in [ax.cbar.ax for ax in self.axes if ax.cbar]:
237 return
237 return
238 if cb_ax.press is None:
238 if cb_ax.press is None:
239 return
239 return
@@ -384,6 +384,8 class PlotData(Operation, Process):
384 ax.cbar.set_label(self.cb_label, size=8)
384 ax.cbar.set_label(self.cb_label, size=8)
385 elif self.cb_labels:
385 elif self.cb_labels:
386 ax.cbar.set_label(self.cb_labels[n], size=8)
386 ax.cbar.set_label(self.cb_labels[n], size=8)
387 else:
388 ax.cbar = None
387
389
388 ax.set_title('{} - {} {}'.format(
390 ax.set_title('{} - {} {}'.format(
389 self.titles[n],
391 self.titles[n],
General Comments 0
You need to be logged in to leave comments. Login now