def show_level(level_start, pix_start, hist): fig, ax = plt.subplots(1, 2, figsize=(30, 10)) plt.subplot(1, 2, 1) vis_baseline = pickable_visu_mpe([hist], ax[1], fig, slice_fun, level_start, True, geom, title='', norm='lin', cmap='viridis', allow_pick=True) vis_baseline.add_colorbar() vis_baseline.colorbar.set_label('Peak position [4ns]') plt.subplot(1, 2, 1) val = hist.fit_result[3, :, 2, 0] val[np.isnan(val)] = 0 val[val < 1.] = 1. val[val > 10.] = 10. vis_baseline.axes.xaxis.get_label().set_ha('right') vis_baseline.axes.xaxis.get_label().set_position((1, 0)) vis_baseline.axes.yaxis.get_label().set_ha('right') vis_baseline.axes.yaxis.get_label().set_position((0, 1)) vis_baseline.image = val fig.canvas.mpl_connect('pick_event', vis_baseline._on_pick) vis_baseline.on_pixel_clicked(pix_start) plt.show()
def show_level(level,hist): fig, ax = plt.subplots(1, 2, figsize=(30, 10)) plt.subplot(1, 2, 1) vis_baseline = pickable_visu_mpe([hist], ax[1], fig, slice_fun, level,True, geom, title='', norm='lin', cmap='viridis', allow_pick=True) vis_baseline.add_colorbar() vis_baseline.colorbar.set_label('Peak position [4ns]') plt.subplot(1, 2, 1) peak = peaks.data[level] peak = peaks.find_bin(np.argmax(peak, axis=1)) vis_baseline.axes.xaxis.get_label().set_ha('right') vis_baseline.axes.xaxis.get_label().set_position((1, 0)) vis_baseline.axes.yaxis.get_label().set_ha('right') vis_baseline.axes.yaxis.get_label().set_position((0, 1)) vis_baseline.image = peak fig.canvas.mpl_connect('pick_event', vis_baseline._on_pick) vis_baseline.on_pixel_clicked(700) plt.show()