Skip to content

Commit

Permalink
REF: Migrate plotting for Bokeh 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kernc committed Dec 12, 2021
1 parent d1775df commit 8b36a6b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions backtesting/_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ def plot(*, results: pd.Series,
new_bokeh_figure = partial(
_figure,
x_axis_type='linear',
plot_width=plot_width,
plot_height=400,
width=plot_width,
height=400,
tools="xpan,xwheel_zoom,box_zoom,undo,redo,reset,save",
active_drag='xpan',
active_scroll='xwheel_zoom')
Expand Down Expand Up @@ -269,7 +269,7 @@ def plot(*, results: pd.Series,
('Volume', '@Volume{0,0}')]

def new_indicator_figure(**kwargs):
kwargs.setdefault('plot_height', 90)
kwargs.setdefault('height', 90)
fig = new_bokeh_figure(x_range=fig_ohlc.x_range,
active_scroll='xwheel_zoom',
active_drag='xpan',
Expand Down Expand Up @@ -334,7 +334,7 @@ def _plot_equity_section(is_return=False):
source.add(equity, source_key)
fig = new_indicator_figure(
y_axis_label=yaxis_label,
**({} if plot_drawdown else dict(plot_height=110)))
**({} if plot_drawdown else dict(height=110)))

# High-watermark drawdown dents
fig.patch('index', 'equity_dd',
Expand Down Expand Up @@ -697,8 +697,8 @@ def plot_heatmaps(heatmap: pd.Series, agg: Union[Callable, str], ncols: int,
y_range=level2,
x_axis_label=name1,
y_axis_label=name2,
plot_width=plot_width // ncols,
plot_height=plot_width // ncols,
width=plot_width // ncols,
height=plot_width // ncols,
tools='box_zoom,reset,save',
tooltips=[(name1, '@' + name1),
(name2, '@' + name2),
Expand Down

0 comments on commit 8b36a6b

Please sign in to comment.