Bokeh plot with equal units for both x and y axis

I am plotting circles in bokeh and I want the units in both axes to be the same.
For eg consider the plot below, why doesn’t the entire circle fit into the square i.e along the y-axis? I have also set match_aspect to True still it is not working. Also apart from this I also wanted to know that is there any option of autoscale() similar to matplotlib or do we have to given the x_range and y_range every time we plot?

Per the documentation, setting the range values explicitly takes precedence over match_aspect. If you set the range values manually, Bokeh assumes you know what you want, and will not override your values, even to preserve aspect matching. If you want match_aspect to function, you have to leave auto-ranging on.

But if I remove the range then the circle does not fit in the figure.

There is a current open issue for the case where there is only one “big” circle (as opposed to lots of circles as scatter markers).

Auto-ranging for wedges (and single circles?) · Issue #11082 · bokeh/bokeh · GitHub

If this (a single big circle) is actually your use-case, a workaround to plot an invisible rect that encloses the circle.

1 Like