1

I currently have a simple line plot using bokeh and some financial data

enter image description here

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)

enter image description here

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.

1 Answer 1

3

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]]

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.