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
Fix for issue #2541 (revised) #2874
Conversation
@@ -151,6 +151,7 @@ def transform_non_affine(self, xy): | |||
|
|||
theta -= theta_offset | |||
theta *= theta_direction | |||
theta = theta % (2 * np.pi) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeps theta between 0 and 2pi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor style: you might as well follow the lead of the two lines above, and use theta %= (2 * np.pi)
.
@Rickkwa Can you also add an entry in CHANGELOG and whats_new.rst? |
@tacaswell What date should I use for the CHANGELOG (date of commit? Today's date?). Also, does a small bug fix like this warrant an entry in the whats_new.rst? It doesn't seem like there is a suitable section. |
I tend to do date of commit (and putting it a bit down well protect you from nasty rebase issues). I think you could put a sentence in the plotting improvements section. |
@Rickkwa This needs to be re-based. |
A simple fix for issue #2541
Explanation:
Say the plot has the 0 facing North and it goes counter clockwise. The offset is 0.5_pi (as set in the set_theta_zero_location() function).
Then if the mouse is in the first quadrant, the theta variable is in the range of [0, 0.5_pi] (before applying offset and direction). In line 152, we account for the offset by subtracting the offset amount.
This gives us a negative number, which is the problem.