Plot size and circle radius

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 …

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.

1 Like

thanks Bryan I will try to draw “circle” by using patches or polygons
:pray:

Ellipse might also be a simpler option, if you do want the circle to “stretch” when aspect stretches.

1 Like

yes it seems to be more simple …

There’s a tangentially related thread here if you do go down the ellipse road → Ellipse at angle buggy

1 Like