Add pan/zoom tools
This commit is contained in:
parent
00b0c2d708
commit
a0c9b0162b
@ -19,8 +19,10 @@ from bokeh.models import (
|
|||||||
Line,
|
Line,
|
||||||
LinearAxis,
|
LinearAxis,
|
||||||
Panel,
|
Panel,
|
||||||
|
PanTool,
|
||||||
Plot,
|
Plot,
|
||||||
RadioButtonGroup,
|
RadioButtonGroup,
|
||||||
|
ResetTool,
|
||||||
Scatter,
|
Scatter,
|
||||||
Select,
|
Select,
|
||||||
Spacer,
|
Spacer,
|
||||||
@ -30,6 +32,7 @@ from bokeh.models import (
|
|||||||
TextAreaInput,
|
TextAreaInput,
|
||||||
TextInput,
|
TextInput,
|
||||||
Toggle,
|
Toggle,
|
||||||
|
WheelZoomTool,
|
||||||
Whisker,
|
Whisker,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -193,7 +196,6 @@ def create():
|
|||||||
y_range=DataRange1d(),
|
y_range=DataRange1d(),
|
||||||
plot_height=400,
|
plot_height=400,
|
||||||
plot_width=700,
|
plot_width=700,
|
||||||
toolbar_location=None,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
plot.add_layout(LinearAxis(axis_label="Counts"), place="left")
|
plot.add_layout(LinearAxis(axis_label="Counts"), place="left")
|
||||||
@ -226,6 +228,9 @@ def create():
|
|||||||
numfit_max_span = Span(location=None, dimension="height", line_dash="dashed")
|
numfit_max_span = Span(location=None, dimension="height", line_dash="dashed")
|
||||||
plot.add_layout(numfit_max_span)
|
plot.add_layout(numfit_max_span)
|
||||||
|
|
||||||
|
plot.add_tools(PanTool(), WheelZoomTool(), ResetTool())
|
||||||
|
plot.toolbar.logo = None
|
||||||
|
|
||||||
# Scan select
|
# Scan select
|
||||||
def scan_table_callback(_attr, _old, new):
|
def scan_table_callback(_attr, _old, new):
|
||||||
if new:
|
if new:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user