Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eb8fa7b

Browse files
committed
Fix the xlim of polar plots
1 parent fdc4154 commit eb8fa7b

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

lib/matplotlib/projections/polar.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,10 @@ def transform_non_affine(self, tr):
5757
t *= theta_direction
5858
t += theta_offset
5959

60-
if rmin != 0:
61-
r = r - rmin
62-
mask = r < 0
63-
x[:] = np.where(mask, np.nan, r * np.cos(t))
64-
y[:] = np.where(mask, np.nan, r * np.sin(t))
65-
else:
66-
x[:] = r * np.cos(t)
67-
y[:] = r * np.sin(t)
60+
r = r - rmin
61+
mask = r < 0
62+
x[:] = np.where(mask, np.nan, r * np.cos(t))
63+
y[:] = np.where(mask, np.nan, r * np.sin(t))
6864

6965
return xy
7066
transform_non_affine.__doc__ = Transform.transform_non_affine.__doc__
@@ -779,4 +775,3 @@ def drag_pan(self, button, key, x, y):
779775
# result = self.transform(result)
780776
# return mpath.Path(result, codes)
781777
# transform_path_non_affine = transform_path
782-

0 commit comments

Comments
 (0)