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

Similar issue & solution to previous issue #232

Open
robertburry opened this issue Mar 31, 2023 · 1 comment
Open

Similar issue & solution to previous issue #232

robertburry opened this issue Mar 31, 2023 · 1 comment

Comments

@robertburry
Copy link

Being a meteorologist, I am not really interesting the Mathematical definition of degrees on a circle. But, rather the meteorological definition which has zero degrees pointed up, then increasing clockwise. This I believe was a similar issue to the closed post here. But I figured I would make a new thread to show how I solved this problem, making it abit cleaner.

As a user of this, it would be nice to pass an optional argument of "Math", "Met" or "Pollut". Which seems like the generic axis orientations that people are trying to accomplish in some threads I have seen.

The solution in the linked issue did help (though I needed to remove the ax.set_theta_direction(-1) for my dataset). But I figured I would add what I ended up doing to make this abit easier for some.

Instead of constructing the list myself I wrote it into a List Comprehension:
[(i + 360) if i < 0 else i for i in range(90,-270,-10)])

so combined it looks like:
ax.set_thetagrids(range(0,360,10),[ ( _+360) if _ < 0 else _ for _ in range(90,-270,-10) ] )

Which gave me the result I was looking for.
output

@scls19fr
Copy link
Member

scls19fr commented Mar 31, 2023

Just a comment about your list comprehension

Modulo can help.

[(90 - i) % 360 for i in range(0, 360, 10)]
  • 90 for EAST
  • -i for clockwise

Similar to #151

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

2 participants