def plot(self):
# Prepare the data
data = self.locs[self.field]
data = data[np.isfinite(data)]
bins = lib.calculate_optimal_bins(data, 1000)
# Prepare the figure
self.figure.clear()
self.figure.suptitle(self.field)
axes = self.figure.add_subplot(111)
axes.hist(data, bins, rwidth=1, linewidth=0)
data_range = data.ptp()
axes.set_xlim([bins[0] - 0.05*data_range, data.max() + 0.05*data_range])
self.span = SpanSelector(axes, self.on_span_select, 'horizontal', useblit=True, rectprops=dict(facecolor='green', alpha=0.2))
self.canvas.draw()
评论列表
文章目录