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

Fix for issue #2541 (revised) #2874

Merged
merged 4 commits into from May 18, 2014
Merged

Fix for issue #2541 (revised) #2874

merged 4 commits into from May 18, 2014

Conversation

Rickkwa
Copy link
Contributor

@Rickkwa Rickkwa commented Mar 7, 2014

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.

theta -= theta_offset

This gives us a negative number, which is the problem.

@@ -151,6 +151,7 @@ def transform_non_affine(self, xy):

theta -= theta_offset
theta *= theta_direction
theta = theta % (2 * np.pi)
Copy link
Contributor Author

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

Copy link
Member

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).

@tacaswell tacaswell added this to the v1.4.0 milestone Mar 7, 2014
@tacaswell
Copy link
Member

@Rickkwa Can you also add an entry in CHANGELOG and whats_new.rst?

@Rickkwa
Copy link
Contributor Author

Rickkwa commented Apr 8, 2014

@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.

@tacaswell
Copy link
Member

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.

@tacaswell
Copy link
Member

@Rickkwa This needs to be re-based.

@tacaswell tacaswell merged commit 0dfe2ad into matplotlib:master May 18, 2014
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

Successfully merging this pull request may close these issues.

None yet

4 participants