☰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

Plot size and circle radius

Community Support
odadoun
odadoun

Hi and happy bokeh year !

I am facing to a simple problem: when figure plot_width = plot_height
the size of my circle is correct

plot = figure(plot_width = 300, plot_height = 300,x_range=[-5,5],y_range=[-5,5])
plot.circle(0, 0, radius = 4, alpha = 0.6,radius_dimension='max')
show(plot)

but when plot_width != plot_height the situation is different

plot = figure(plot_width = 500, plot_height = 300,x_range=[-5,5],y_range=[-5,5])
plot.circle(0, 0, radius = 4, alpha = 0.6,radius_dimension='max')
show(plot)

As you can see now he circle is greater than the radius in the y direction…
What should I do to keep the size of my circle unchanged ?
By advance thank
Olivier
PS:I have tried several option : radius_dimension, match_aspect …

⌁   Link to post
Bryan
Bryan

match_aspect only functions with auto data-ranges (which are the default). If you set the axis bounds manually Bokeh assumes you know what you want and will not override those settings, even to preserve aspect. If data ranges are not an option then your best bet is probably to draw a “circle” by using patches or polygons with many points to get whatever result you want (it’s not clear if you want the circle to “stretch” when the aspect ratios don’t match, as they don’t above)

radius_dimension is a very low-level fiddly hack that was added before match_aspect was introduced. It’s probably best avoided at this point.

⌁   Link to post

End of archived discussion · Replies are disabled