Equal Tick Interval and Aspect Ratio in Axis

  • Bokeh cannot change the size of physical pixels
  • The size of the axis “frame” also cannot be specified arbitrarily. It is affected by: min border settings, layout mode and canvas size, adjustments to make space for tick labels, and other things.

Therefore, the only remaining lever Bokeh can use to match the data/pixel aspect ratios is to adjust the range start/end however is necessary. But that’s only if you don’t override with manual ranges. If you have a roughly square canvas, and specify xr = (-150, 150) and yr = (-320, 320) (i.e. roughly what you have done above) then there is no mathematical way to make the data/pixel aspect ratios match.

it’s not possible to have a plot with an aspect ratio of 1 and the plot located in a desired position

More or less, if I understand your meaning. You could add transparent glyphs for the data-ranges to have to account for as way to roughly manipulate the range extents, beyond what your visible glyphs dictate. But yes: aspect matching, and explicit range control are fundamentally incompatible.

with tick interval constant

This is completely orthogonal, and unrelated. Tickers are a property of an Axis, and only take the range bounds in to consideration. You can set any ticker you like, with or without, aspect matching enabled. All of the tickers are listed here:

It sounds like you might want the SingleIntervalTicker.

1 Like