0

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.

Jase
  • 1,025
  • 1
  • 9
  • 34
  • You may have to embed this into your own html template to achieve the customisation as suggested here - https://stackoverflow.com/questions/40413198/bokeh-responsive-row-with-items-of-unequal-width – viggnah Aug 11 '22 at 05:05
  • Correct. Bokeh `row` and `column` and `gridplot` are all very simple and only support equal divisions. Anything more complicated will require embedding into your own template that can be styled or layed out precisely to requirements using standard HTML/CSS. – bigreddot Aug 11 '22 at 18:03

0 Answers0