Add a hex tiling glyph #4786
Add a hex tiling glyph #4786
Comments
merge with #4342 |
Drawing a hex glyph would be trivial, I guess the interesting part is integrating a hex coordinate system reasonably. |
Well if it was basically a marker (so it was just an x y center) then users could figure it out for now. Sarah Bird
|
Would need to be more robust than a marker for feature rich binning visualizations |
@birdsarah I'm -1 on adding a hard-to-use for things-people-really-want interface, and accumulating knowledge on here, SO and the mailing list that will only have to be updated/countered/deprecated later. Offhand, I think a
This is off the top of my head. We should compare to what other systems do. Whatever we do, I think there are the same/similar problems that e.g. circles have in non 1-1 coordinate systems. |
Looking at the matplotlib and R implementation of hexbin, this seems like two separate issues:
The hexagonal binning and plotting algorithm could use hexagon markers/glyphs but this would likely lead to overlapping similar to issue #3315, in which histogram bars overlap. Also, it makes sense for the hexagon marker (point 1) to have a symmetric shape regardless of the plot aspect ratio. For binning and plotting data using a hexagonal grid, it would make sense to have non-symmetric hexagons which match the aspect ratio of the plot. See attached demo showing a zoomed in version of matplotlib's implementation. |
Agree with @stvn66. Looks like there are a couple of ideas bouncing around that could compliment each other as incremental development goals.
|
These examples from the D3 gallery show two options of visualizing a hexbin plot:
This second option may be more complicated to get the scaling of markers/glyphs to match the scaling of the plotting area when using different scaling for the x/y axes. |
How much overlap is there between the bokehjs in rbokeh and python bokeh? I just saw that rbokeh has hexbin plots. |
100% overlap, RBokeh uses the same BokehJS as-is. AFAIK (or have to assume) RBokeh supports hex charts by computing hexagon coordinates in R and drawing as |
That's correct. |
This is obviously an old discussion but I'm interested in reviving it. I think there are two separate things, both worth doing:
|
I've made #7638 to describe the marker, this issue can be for the hex tiling glyph |
That's very exciting
…Sent from my iPhone
On Mar 23, 2018, at 12:24 AM, Bryan Van de Ven <notifications@github.com> wrote:
PR coming tomorrow
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@birdsarah do you know how the larger outlined regions in your original example are specified? I could imagine a couple of possible ways to spell that but not sure if there is a standard way |
In matplotlib the X-Y span is a rectangular range that is the range of the data or the regione defined by the |
@tritemio this work is not concerned with binning, and it's not clear that core bokeh itself will have any binning built in. This PR adds a basic glyph for drawing regular (data-space) hex tiles in an axial coordinate system. This is the foundation upon which a "hexbin" command might be built (e.g. by Holoviews) For reference, the above image was generated by hand with this code:
|
I see, thanks for the clarification. So this is actually a rectangular binning plotted with contiguous hex tiles. Sorry if OT, any idea or references on how to compute (not plot) the actual hex binning? |
No, that is not correct, the example code above is doing a real hex binning. The block of the code with |
Ops, thanks for the correction. I'll look into it more carefully! |
@tritemio just as an update, I don't think that opaque code with floors is correctly doing a hex binning, at least not for the version of axial coords I am using. So we are looking to find or implement something a bit more straightforward and comprehensible |
PR is merged with API docs and some examples. User's Guide docs coming in a separate PR. |
hex binning is useful (https://cran.r-project.org/web/packages/hexbin/vignettes/hexagon_binning.pdf) and I've seen a lot of cool hexmaps recently: http://www.theguardian.com/politics/ng-interactive/2016/jun/23/eu-referendum-live-results-and-analysis
The text was updated successfully, but these errors were encountered: