Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/demo/financial/correlations.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ def _create_returns_plot(self):
renderer.tools.append(RangeSelection(renderer, left_button_selects = False,
auto_handle_event = False))
plot.tools.append(PanTool(plot, drag_button="left", constrain=True,
constrain_direction="x"))
plot.overlays.append(ZoomTool(plot, tool_mode="range", max_zoom_out=1.0))
constrain_direction="x", restrict_to_data=True))
plot.overlays.append(ZoomTool(plot, tool_mode="range", max_zoom_out=1.0, x_min_zoom_factor=float(1e-3)))
# Attach the range selection to the last renderer; any one will do
self._range_selection_overlay = RangeSelectionOverlay(renderer,
metadata_name="selections")
Expand Down
4 changes: 3 additions & 1 deletion examples/demo/financial/stock_prices.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,14 @@ def _create_price_plots(self, times, prices, mini_height=75):

# Add pan and zoom
price_plot.tools.append(PanTool(price_plot, constrain=True,
constrain_direction="x"))
constrain_direction="x",
restrict_to_data=True))
price_plot.overlays.append(ZoomTool(price_plot, drag_button="right",
always_on=True,
tool_mode="range",
axis="index",
max_zoom_out_factor=1.0,
x_min_zoom_factor=float(1e-3)
))

# Create the miniplot
Expand Down
8 changes: 7 additions & 1 deletion examples/demo/shell/dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@
# Add some titles
title("Plotting Dates")

current_plot = curplot()
# Set the plot's horizontal axis to be a time scale
curplot().x_axis.tick_generator.scale = CalendarScaleSystem()
current_plot.x_axis.tick_generator.scale = CalendarScaleSystem()
zoom_tool = current_plot.overlays[2]
pan_tool = current_plot.tools[0]
zoom_tool.x_min_zoom_factor = float(1e-3)
pan_tool.restrict_to_data = True


# This command is only necessary if running from command line
show()
Expand Down