circle size

Hi,
I am trying to plot a circle of a given radius, doing

f.circle([0.], [0.], radius = 1., fill_alpha=0.01)

``

The plot I get however shows the circle to be actually an ellipsoid, as along the y axis the radius is less than one! See the picture

What am I missing?

The issue is that your central plot region is not square, or more generally, that your "data" and "pixel" aspect ratios are different. If you want circles to be true circles not just in a pixel/screen sense, but also in a "data" sense, then you need to take steps to ensure that the aspect ratios are the same at all times.

There is no setting yet to directly control the (pixel) size of the central plot area. But you can use settings like min_border to enforce a uniform plot border on all sides that can will always be bigger than the plot labels, and you can also rotate the angle of the tick labels on the y-axis so that they don't take up as much space. This can effectively control the pixel aspect ratio of the central area.

Regardless of what the border sizes you choose, even if they are not uniform all around, you need to make sure the "data" aspect ratio matches the "pixel" aspect ratio. As a concrete example: if the central plot area (not the whole canvas, the central area bound by axes) is 300x400 pixels, then the ratio of your x-range and y-range *must* be 3/4. For example if the x_range is (0, 80) then the y_range must span a distance of 60. That will yield circles that are also circular in "data" space.

The fundamental issue is that in translating from "data distances" for radius, practically speakin, that radius distance has to be measured along *some particular* direction. If the pixel/data aspect ratios are not the same, then measuring along different directions will yield different results.

Bryan

ยทยทยท

On Aug 31, 2016, at 9:05 AM, [email protected] wrote:

Hi,
I am trying to plot a circle of a given radius, doing

f.circle([0.], [0.], radius = 1., fill_alpha=0.01)

The plot I get however shows the circle to be actually an ellipsoid, as along the y axis the radius is less than one! See the picture

What am I missing?

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/468e24bd-d067-45f7-bde7-a6b237d5a4cd%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.