Skip to content
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

Rotating polar plot coordinates? #168

Open
rfritz opened this issue Dec 27, 2022 · 6 comments
Open

Rotating polar plot coordinates? #168

rfritz opened this issue Dec 27, 2022 · 6 comments

Comments

@rfritz
Copy link

rfritz commented Dec 27, 2022

Enhancement request

I recently tried using GR via Plots.jl to produce a polar plot of luminaire photometry. I was quite surprised to discover that there no way to change the polar coordinates used by GR. No matter what I did, 𝜃 = 0° was always at the right of the chart and type C photometry is usually presented with 𝜃 = 0° at the bottom.

So this is a request for the ability to rotate the axis of the polar graph.

Dan, over on the Julia Discourse board, provided a Julia function which made it work, and so I have graphs to present, showing what is currently supported and what I actually wanted.

What I could get from unmodified GR:
image

What I wanted:
image

@jheinen
Copy link
Collaborator

jheinen commented Dec 29, 2022

Thanks for the FR. We will support this with the next release.

@AhmedSalih3d
Copy link

First and foremost; @jheinen thank you for the great work you are putting into this library!

Can I ask if this has this been natively implemented?

I stumbled upon this today and was surprised I could not do it

Kind regards

@jheinen
Copy link
Collaborator

jheinen commented Apr 2, 2023

In GR.jl, you can now set an offset ("E", "N", "W", "S") and the direction (1, -1):

using GR
angles = LinRange(0, 2pi, 40)
radii = LinRange(0, 2, 40)
polar(angles, radii, theta_zero_location="S", theta_direction=-1)

Screenshot 2023-04-02 at 07 48 46

@AhmedSalih3d
Copy link

In GR.jl, you can now set an offset ("E", "N", "W", "S") and the direction (1, -1):

using GR
angles = LinRange(0, 2pi, 40)
radii = LinRange(0, 2, 40)
polar(angles, radii, theta_zero_location="S", theta_direction=-1)
Screenshot 2023-04-02 at 07 48 46

Thank you that is amazing! I suppose the issue can be closed then, seems to satisfy @rfritz original request?

As a side-note; how did you get such a pretty font in the plot / how would I do that?

Kind regards

@jheinen
Copy link
Collaborator

jheinen commented Apr 2, 2023

This is the default font in GR: Computer Modern

@rfritz
Copy link
Author

rfritz commented Apr 5, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants