Polar Projection

Hello,

Is there a polar plot available in Bokeh?

I try to plot polar graph like the following picture but i couldn’t find a way to do it in Bokeh.

polar.png

I think that is one of type of the plot that developer team may consider to add to Bokeh.

Seaborn does have polar projection but i couldn’t find in Bokeh

https://seaborn.pydata.org/examples/facet_projections.html

Thank you,

John

Hi,

Bokeh can certainly *draw* plots like or similar to the one you show, e,g.

  https://bokeh.pydata.org/en/latest/docs/gallery/burtin.html

But Bokeh does not have built in capability for:

* mapping polar coordinates (either on the Python or Javascript sides)
* drawing polar axes and labels, etc.

So currently to produce a chart like the one you show, all of that work has to be done "by hand".

There is an existing old issue regarding adding support for polar mappings:

  https://github.com/bokeh/bokeh/issues/657

And there is even a small proof of concept using CustomJSTransform in one of the comments. If someone is interested in working on this, i.e. to create a more supported, built-in capability, I'd be happy to help advise/provide guidance. I think it's unlikely given current available resources that anyone on the core team will be able to prioritize it in the near future.

Thanks,

Bryan

···

On Feb 7, 2019, at 13:01, [email protected] wrote:

Hello,

Is there a polar plot available in Bokeh?
I try to plot polar graph like the following picture but i couldn't find a way to do it in Bokeh.
<polar.png>

I think that is one of type of the plot that developer team may consider to add to Bokeh.
Seaborn does have polar projection but i couldn't find in Bokeh
https://seaborn.pydata.org/examples/facet_projections.html

Thank you,
John

--
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/ed4d16ae-b4b6-4dd6-881b-f3a596f4b893%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.
<polar.png>

Thank you.

···

On Thursday, February 7, 2019 at 11:46:09 AM UTC-8, Bryan Van de ven wrote:

Hi,

Bokeh can certainly draw plots like or similar to the one you show, e,g.

    [https://bokeh.pydata.org/en/latest/docs/gallery/burtin.html](https://bokeh.pydata.org/en/latest/docs/gallery/burtin.html)

But Bokeh does not have built in capability for:

  • mapping polar coordinates (either on the Python or Javascript sides)

  • drawing polar axes and labels, etc.

So currently to produce a chart like the one you show, all of that work has to be done “by hand”.

There is an existing old issue regarding adding support for polar mappings:

    [https://github.com/bokeh/bokeh/issues/657](https://github.com/bokeh/bokeh/issues/657)

And there is even a small proof of concept using CustomJSTransform in one of the comments. If someone is interested in working on this, i.e. to create a more supported, built-in capability, I’d be happy to help advise/provide guidance. I think it’s unlikely given current available resources that anyone on the core team will be able to prioritize it in the near future.

Thanks,

Bryan

On Feb 7, 2019, at 13:01, [email protected] wrote:

Hello,

Is there a polar plot available in Bokeh?

I try to plot polar graph like the following picture but i couldn’t find a way to do it in Bokeh.

<polar.png>

I think that is one of type of the plot that developer team may consider to add to Bokeh.

Seaborn does have polar projection but i couldn’t find in Bokeh

https://seaborn.pydata.org/examples/facet_projections.html

Thank you,

John


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/ed4d16ae-b4b6-4dd6-881b-f3a596f4b893%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

<polar.png>

I think Bokeh is wonderful, but the lack of polar plots is a deal breaker for us. Polar plots are an essential type in so many scientific applications. Consider wind speed and direction over a 4 hour time period as plotted unsing dash/plotly.
image
I don’t want to use Dash/Plotly, I think their approach is inferior to Bokeh and their community support has not been very good. Oh yeah, Bokeh documentation is much better. But we just have to have polar plots!

@Glenn_Nelson

While there is no built-in polar plot method in bokeh, you still should be able to create your own function for this with modest effort.

See this link for the beginning step to create the circular plot region. https://discourse.bokeh.org/t/grid-masking/5633/5.

Beyond that the plot configuration comprises (i) hiding the rectangular gridlines, (ii) adding Annulus glyphs (with equal inner- and outer- radii) and corresponding LabelSets for the constant speed radii, and (iii) adding Line glyphs and corresponding LabelSets for the cardinal and ordinal directions.

Then, convert your polar data to (x,y) points in the source passed to whatever glyph (e.g. circles) you choose to render the data.

Here’s another example of a radial equalizer, which I am working on as a user-interface to tune weights in a high-dimensional optimization problem.

So, although its different in the details and application, using glyphs and callbacks on them to set algorithm parameters rather than visualize data, the example is meant to show that all of the capabilities to do what you want and make it look how you want are probably available in bokeh already.