Skip to content

Commit 53342c6

Browse files
committed
Fix mouse-over display for reversed polar plots
Close issue #2541 Merge remote-tracking branch 'Rickkwa/master' Conflicts: CHANGELOG doc/users/whats_new.rst
2 parents 9d8561c + 0dfe2ad commit 53342c6

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

CHANGELOG

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
the managemnet of the xlimits and ticks when making a boxplot.
3434
Default in True which maintains current behavior by default.
3535

36+
2014-03-23 Fixed a bug in projections/polar.py by making sure that the theta
37+
value being calculated when given the mouse coordinates stays within
38+
the range of 0 and 2 * pi.
39+
3640
2014-03-22 Added the keyword arguments wedgeprops and textprops to pie.
3741
Users can control the wedge and text properties of the pie
3842
in more detail, if they choose.
@@ -46,7 +50,7 @@
4650
2014-02-28 Added 'origin' kwarg to `spy`
4751

4852
2014-02-27 Implemented separate horizontal/vertical axes padding to the
49-
ImageGrid in the AxesGrid toolkit
53+
ImageGrid in the AxesGrid toolkit
5054

5155
2014-02-27 Allowed markevery property of matplotlib.lines.Line2D to be, an int
5256
numpy fancy index, slice object, or float. The float behaviour

doc/users/whats_new.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,15 @@ shows markers at approximately equal display-coordinate-distances along the
182182
line.
183183

184184

185+
Fixed the mouse coordinates giving the wrong theta value in Polar graph
186+
```````````````````````````````````````````````````````````````````````
187+
Added code to
188+
:funct:`~matplotlib.InvertedPolarTransform.transform_non_affine`
189+
to ensure that the calculated theta value was between the range of 0 and 2 * pi
190+
since the problem was that the value can become negative after applying the
191+
direction and rotation to the theta calculation.
192+
193+
185194
Date handling
186195
-------------
187196

lib/matplotlib/projections/polar.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ def transform_non_affine(self, xy):
151151

152152
theta -= theta_offset
153153
theta *= theta_direction
154+
theta %= 2 * np.pi
154155

155156
r += rmin
156157

0 commit comments

Comments
 (0)