Reputation: 7338
I currently have a simple line plot using bokeh and some financial data
I would like to be able to add an extra line plot on top of this line plot, confined to its own space but still sharing the same date axis as the original figure, similar to the image below (highlighted in yellow)
How can I do this using bokeh? So far I have found some related material on bokeh horizon plots, but everything I've tried with this doesn't really work.
For reference, I am following the sentdex tutorial on youtube where he creates the desired chart using matplotlib.
Upvotes: 1
Views: 1802
Reputation: 34628
You will have to share ranges, stack the plots, and turn off the x-axis in the top plot, as is done in the OHLC streaming example:
p = figure(plot_height=500, tools="xpan,xwheel_zoom,xbox_zoom,reset",
p2 = figure(plot_height=250, x_range=p.x_range, y_axis_location="right")
layout = gridplot([[p], [p2]]
Upvotes: 3