Gridplot has unexpected sizing behavior

When using a layout like row or column, setting sizing_mode="stretch_width" allows for responsive resizing. However, when using gridplot, it appears that the gridpolot is responsive, but the figures inside the gridplot are set to their minimum size.

from bokeh.layouts import gridplot
from bokeh.models import ColumnDataSource
from bokeh.plotting import figure
from bokeh.server.server import Server

def render_composite_view(doc):
    source = ColumnDataSource({'x': [1, 2, 3, 4, 5], 'y': [1, 2, 3, 4, 5]})
    plot = figure(title="test plot", sizing_mode="stretch_width")
    plot.step('x', 'y', source=source)
    grid = gridplot([[plot]], sizing_mode="scale_width", )

if __name__ == '__main__':
    server = Server({'/render_composite_view': render_composite_view, },
                    allow_websocket_origin=["localhost:5000", "localhost:5006", "localhost", '*'],
    server.io_loop.add_callback(, "/render_composite_view")

@Cosmidark please always, always provide version information. There have been many changes to layout handling over Bokeh’s 12 year history, it is not possible to speculate about anything without knowing what version this concerns.

bokeh version is 3.0.3
python version is 3.9.5

Well, I guess this is some kind of bug with gridplot, and it happens in the latest dev branch too. Please open a GitHub Issue with these details.

Ok, will do.

The reason I was using gridplot is b/c it provides a single toolbar that applies to all charts. Is there a way to do this with column?

No, only gridplot has he combined toolbar.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.