-
-
Notifications
You must be signed in to change notification settings - Fork 302
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
Add polar plot and scatter recipes #1706
Conversation
@garrekstemo any chance you could take this opportunity to also add a polar heatmap? Now that you have the concepts fresh in your mind, maybe it is easy to consider this plot as well? |
I think the way we would want to implement polar plots is by adding a transform function (https://github.com/JuliaPlots/Makie.jl/blob/f04ea93cde4384bad3f008bddf291a15ac35774a/src/layouting/transformation.jl) that converts polar to Cartesian coordinates. That way (r, \theta) inputs would work for any plot that uses that transform. Polar axis should probably be their own separate thing. I.e. we should have something like |
OK, that makes a lot more sense and would be more generalizable. I'll close this PR and help out with transform functions where I can. |
I'm interested in something quite similar, I'd like to do azimuthal projections (e.g. Lambert equal-area). Are there any plot examples/recipes currently using the built in transformation mechanism? GeoMakie uses PROJ for transformations but I'd rather do it all in Julia. Obviously this would also be the case for the polar plots. |
GeoMakie is now just a wrapper around Axis with some conveniences for projections, but does everything else using the Scene transformation interface, specifically I have been meaning to make a sort of "NonlinearAxis" As of now it should be easy to simply feed a polar-to-cartesian converter to transform_func and possibly use the framework of this PR to draw gridlines. The only question then would be the logic of where and how to draw ticks... |
Thanks for the info, I should have checked more of the GeoMakie source. I'll try with transform_func, since I don't really need ticks for my case ("pole figures" of crystalline texture, Wikipedia, rust prototype) The contouring might get interesting. I don't expect this kind of plot in particular to be included in Makie core, but drawing the basic axis is similar to a polar plot. If NonlinearAxis is on the table, then I'll also mention stereographic plots in general. I can try to help with all of the above. |
I've started a thread over at discourse to discuss this. I'm also interested in doing Ternary plots, and can try to help with that as well later. |
Description
Fixes # 521
I added two recipes for creating polar plots and scatter polar plots, following the plan posted in issue #521 by @asinghvi17. I understand (from other issues) that there is some inconsistency with how Attributes are used, so I wasn't sure what to do there and mostly followed other recipes. I also would like to remove the xy axes spines and decorations, but I have seen elsewhere that this is under consideration since recipes are apparently older than the Axis framework. I wasn't sure how to handle the docs, and I put the
lines!
plot andscatter!
plot examples in the same .md file. The plots I include in the docs are attached to this PR.As far as setting r-ticks and theta-ticks, does my solution look reasonable? I thought this in particular would need to be reviewed.
(This is my first PR (ever!), so please guide me if there's something I'm missing)
Type of change
Checklist
Images
polar(r, theta)
polarscatter(r, theta)