Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7731471

Browse filesBrowse files
committed
ENH: Allow setting angle limits on PolarAxes.
Setting angular limits allows one to create "wedges" instead of a full circle or annulus.
1 parent 720a16d commit 7731471
Copy full SHA for 7731471

File tree

Expand file treeCollapse file tree

8 files changed

+9099
-964
lines changed
Filter options
Expand file treeCollapse file tree

8 files changed

+9099
-964
lines changed

‎lib/matplotlib/projections/polar.py

Copy file name to clipboardExpand all lines: lib/matplotlib/projections/polar.py
+273-78Lines changed: 273 additions & 78 deletions
Large diffs are not rendered by default.
Binary file not shown.
Loading

‎lib/matplotlib/tests/baseline_images/test_axes/polar_theta_position.svg

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/baseline_images/test_axes/polar_theta_position.svg
+864-886Lines changed: 864 additions & 886 deletions
Loading
Binary file not shown.
Loading

‎lib/matplotlib/tests/baseline_images/test_axes/polar_theta_wedge.svg

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/baseline_images/test_axes/polar_theta_wedge.svg
+7,939Lines changed: 7939 additions & 0 deletions
Loading

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+23Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,29 @@ def test_polar_rlabel_position():
467467
ax.set_rlabel_position(315)
468468

469469

470+
@image_comparison(baseline_images=['polar_theta_wedge'])
471+
def test_polar_theta_limits():
472+
r = np.arange(0, 3.0, 0.01)
473+
theta = 2*np.pi*r
474+
475+
theta_mins = np.arange(15.0, 361.0, 90.0)
476+
theta_maxs = np.arange(50.0, 361.0, 90.0)
477+
478+
fig, axes = plt.subplots(len(theta_mins), len(theta_maxs),
479+
subplot_kw={'polar': True},
480+
figsize=(16, 12))
481+
482+
for i, start in enumerate(theta_mins):
483+
for j, end in enumerate(theta_maxs):
484+
ax = axes[i, j]
485+
if start < end:
486+
ax.plot(theta, r)
487+
ax.set_thetamin(start)
488+
ax.set_thetamax(end)
489+
else:
490+
ax.set_visible(False)
491+
492+
470493
@image_comparison(baseline_images=['axvspan_epoch'])
471494
def test_axvspan_epoch():
472495
from datetime import datetime

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.