☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Get the plot width in Python when stretch_width is used

Community Support
Jean-Christophe_Mala
Jean-Christophe_Mala

Hi,

I have an time series of 5 millions points. In order to display it quickly when I handle it (zoom, pan), this time series is resampled according to xmin, xmax and plot_width parameters with a code in Python.

If I fix the “plot_width” parameter in the figure, the resampling works fine but the figure is not responsive. And if I use “stretch_width” as value of “sizing_mode” parameter, the figure is responsive but the resampling algorithm is wrong because I am not able to get the real plot_width. If I cannot get the real plot_width, I would like to get the width of the browser’s window but I do not find the way to do it.

So my question is : is it possible to get the plot_width of a figure when sizing_mode=stretch_width or the width of the browser’s window ?

Thanks a lot,
Jean-Christophe

⌁   Link to post
Bryan
Bryan

Plots / figures have inner_width and outer_width properties that give the width/height of the interior plot frame (i.e. excluding axes/border) that update whenever a plot is resized. AFAIK there is not any property that property that records an updated full canvas size (usually the frame dimensions are what are needed)

⌁   Link to post
Bryan
Bryan

@Jean-Christophe_Mala It should have been possible to get initial events since

But there has been alot of internal work in the last six months, it’s possible there was a regression. Can you provide a minimal script that demonstrates that these are not available at first render?

⌁   Link to post

End of archived discussion · Replies are disabled