plotly / plotly.js

Open-source JavaScript charting library behind Plotly and Dash
https://plotly.com/javascript/
MIT License
16.72k stars 1.83k forks source link

Polar contour plot / Contourpolar request #4992

Open silvanbrummen opened 3 years ago

silvanbrummen commented 3 years ago

Hi!

Your plotting library is really awesome! Thanks for that!

I'm currently trying to make the switch from matplotlib (for Python plots) to Plotly (also Python) and I was looking for an option to display contour plots in a polar coordinate system.

I came across the following issue in plotly.py where @emmanuelle suggested to create a post here in plotly.js.

Do you guys have the intention of creating a Contourpolar type of chart? Similar to the plot show below (created in matplotlib): image (source)

I've tried the Barpolar option, but it's not sufficient for the amount of detail I would like to visualize (a 360 degree water surface elevation plot), I think the plot I would like to display greatly benefits from being a contour plot.

Thanks in advance, Sil

nicolaskruchten commented 3 years ago

This would be a great addition to the library, and we'd be happy to work with someone who wants to add it :)

silvanbrummen commented 3 years ago

Great!

If there is any Python work that could be done in order to implement this kind of chart/trace, I'm willing to contribute. Although I do have the feeling that the Plotly codebase is JavaScript and all Python code is autogenerated from JavaScript. Is that correct?

nicolaskruchten commented 3 years ago

You're correct that the plotly.graph_objects Python module is largely auto-generated, but there is still a lot in Python e.g. plotly.subplots, plotly.express etc. New trace types need to be implemented in Javascript, but there is also the option of building a Figure Factory which leverages existing trace types. For example we have a ternary contour figure factory which does something similar to what you're looking for: contours in non-cartesian coordinates. So if you wanted you could build a create_polar_contour figure factory along the same lines :)

silvanbrummen commented 3 years ago

Alright, good to know that there is an option to add to Python code directly.

I'll give it a go by using the Figure Factory. Thanks for the help so far.

archmoj commented 3 years ago

FYI - Here is @emmanuelle's PR that added ternary contour to plotly.py https://github.com/plotly/plotly.py/pull/1413

coolbud140 commented 3 years ago

Hi there,

Thanks for all the wonderful work!

Has there been any development on this issue? Polar contour plot is something very useful for what I'm working on.

Thanks