Skip to content

Commit 8b36a6b

Browse files
committed
REF: Migrate plotting for Bokeh 3.0
1 parent d1775df commit 8b36a6b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

backtesting/_plotting.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ def plot(*, results: pd.Series,
212212
new_bokeh_figure = partial(
213213
_figure,
214214
x_axis_type='linear',
215-
plot_width=plot_width,
216-
plot_height=400,
215+
width=plot_width,
216+
height=400,
217217
tools="xpan,xwheel_zoom,box_zoom,undo,redo,reset,save",
218218
active_drag='xpan',
219219
active_scroll='xwheel_zoom')
@@ -269,7 +269,7 @@ def plot(*, results: pd.Series,
269269
('Volume', '@Volume{0,0}')]
270270

271271
def new_indicator_figure(**kwargs):
272-
kwargs.setdefault('plot_height', 90)
272+
kwargs.setdefault('height', 90)
273273
fig = new_bokeh_figure(x_range=fig_ohlc.x_range,
274274
active_scroll='xwheel_zoom',
275275
active_drag='xpan',
@@ -334,7 +334,7 @@ def _plot_equity_section(is_return=False):
334334
source.add(equity, source_key)
335335
fig = new_indicator_figure(
336336
y_axis_label=yaxis_label,
337-
**({} if plot_drawdown else dict(plot_height=110)))
337+
**({} if plot_drawdown else dict(height=110)))
338338

339339
# High-watermark drawdown dents
340340
fig.patch('index', 'equity_dd',
@@ -697,8 +697,8 @@ def plot_heatmaps(heatmap: pd.Series, agg: Union[Callable, str], ncols: int,
697697
y_range=level2,
698698
x_axis_label=name1,
699699
y_axis_label=name2,
700-
plot_width=plot_width // ncols,
701-
plot_height=plot_width // ncols,
700+
width=plot_width // ncols,
701+
height=plot_width // ncols,
702702
tools='box_zoom,reset,save',
703703
tooltips=[(name1, '@' + name1),
704704
(name2, '@' + name2),

0 commit comments

Comments
 (0)