New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
circle not circular #7218
Comments
That's just a coincidence that comes from this particular setup of ranges. |
|
Yeah, I thought that |
I think perhaps some glyphs are not reporting their bounds very well, causing |
To be clear, I see the same behavior with or without the match_aspect argument. (You may already know that ;) )
|
Perhaps the following observation is also of some help: as soon as you manually adjust the x or y range either by I'm still having trouble to understand why |
@mansenfranzen that is entirely expected. Aspect matching only applies to auto ranging a with DataRange1d. If you manually and explicitly override things, Bokeh assumes you know what you are doing and honors the values you set. As for the second, do you mean in general? It's because the low level canvas always draws actual circles regardless of the aspect ratio (i.e. nothing automatically squeezes it in to an ellipse,which is what a purely mathematical viewpoint would dictate). There is much discussion in old issues please refer to them. |
@bryevdv Thanks for the clarification. I finally got the point that the low level canvas draws circles irrespective of the aspect ratio. It explains the different behavior between |
I was a bit cursory in my response. It is in fact possible to apply a scale transform to get the canvas to draw ellipses according to aspect at a low level. So the question becomes: is it appropriate to do so? The vast majority of uses of circle are for scatter plots, in which you always want small, actual circles, regardless of aspect, and thus the answer is "probably not really, definitely not in general" The issue really only affects "big" circles, in which case there is |
OK I think I know why this is happening. First note that the following code does work:
The reason for this (I believe) is that the match aspect adjustment is being made too early. The plot canvas collects all the glyph reported bounds, then applies match aspect to all of them separately. Then later the data range unions all the reported bounds, but only the ones that are in it's renderers lists. @tvaught It just happens that by choosing to split the two "diameters" into four "radiuses" exposes the issue, because the match aspect is not happening on the aggregated bounds for all the lines. So the somewhat good news is that I think things will work in many common situations. The better news is that I think the solution is just to make |
OK I will push PR soon. The changes make the original code work as expected. I do think there are some caveats, in particular I think use of |
@bryevdv I understand that in most cases circles are actually used as true circles irrespective of aspect ratio as in scatter plots. However, when composing glyphs to create new plots Iike a radial heatmap (like this PR in holoviews) , I expect glyphs to behave consistently on the same coordinate system. In the mentioned PR, it's not just I really love bokeh and the interactive/linked plots it allows to create but the inconsistent behavior of low level glyphs (in this case only circular glyphs) forced me thinking about using other plotting libraries (in the case of radial heatmaps). I guess new users who want to create new plots themselves would also expect circles and any other glyph to respect the aspect ratio. I would love to see circular glyphs being able respect aspect ratios (if required to be set as a parameter/option). Yet, I have no clue where to start in order to get my head around how to accomplish this. Do you have some hints where I could start to look at? Perhaps I can be of a little help here. |
@mansenfranzen that's what |
Version Information:
On Mac OS X 10.13.1 (High Sierra)
Python: 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20 2016, 23:05:08)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
IPython: 5.3.0
Bokeh: 0.12.10
Problem:
When using
p.circle(...)
, the rendered circle is not perfectly circular. Thex
dimension seems to render according to the supplied radius argument, but they
dimension is visibly short of the specified radius.To reproduce:
The following code creates the screenshot below:
Note: When you uncomment the line beginning with
#p.rect(...
the dimensions of the rendered circle seem fine. e.g.:Best,
Travis
The text was updated successfully, but these errors were encountered: