Jase
Jase

Reputation: 1105

How to proportionally size plots' height in Bokeh?

I want two plots that stretch to fill up the entire window, like this:

# to run this, use:       bokeh serve --show test.py

from bokeh.layouts import column
from bokeh.plotting import figure, curdoc

x = list(range(11))
y0 = x
y1 = [10 - i for i in x]

s1 = figure(width=250, height=250, background_fill_color="#fafafa")
s1.circle(x, y0, size=12, color="#53777a", alpha=0.8)

s2 = figure(width=250, height=250, background_fill_color="#fafafa")
s2.triangle(x, y1, size=12, color="#c02942", alpha=0.8)


curdoc().add_root(column(s1, s2, sizing_mode="stretch_both"))

enter image description here

However, I want the bottom plot's height to be 25% as tall as the first plot.

I've tried frame_height inside the second figure constructor, but that only accepts fixed numbers, not proportional ones.

Upvotes: 0

Views: 468

Answers (0)

Related Questions