slect0r = Selector(plot, plotWidget) plot.overlays.append(slect0r) plot.tools.append(NonAxisPan(plot)) zoom = axisZoom(component=plot) plot.overlays.append(zoom) plot.value_range.tight_bounds = False plot.index_range.tight_bounds = True plot.value_range.margin = 0.1 menuActions = {"printbla": printbla, "Manually set Selection": partial(manuallySetSelection, sel=slect0r)} plot.tools.append(ContextMenu(plot, plotWidget, menuActions)) plot.overlays.append(TimeMarker(plot)) plot.plot(("index", "y0", "y1", "y2"), name="j_n, n<3", color="red") doet = plot.plot(("index", "y3"), name="j_3", color="blue", type="line") plot.add_xy_plot("const", "const", ConstPlot, name="const", color="blue") def tickFormatter(value): return "{:+3.2g}".format(value) plot.value_axis.tick_label_formatter = tickFormatter plotWidget.setPlot(plot) def print0r(widget): print "Selected region: ", widget.plot.selection plotWidget.selectionChanged.connect(print0r) main_window.setCentralWidget(containter) main_window.show() runBenchmark = False