Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit7731471

Browse files
committed
ENH: Allow setting angle limits on PolarAxes.
Setting angular limits allows one to create "wedges" instead of a fullcircle or annulus.
1 parent720a16d commit7731471

File tree

8 files changed

+9099
-964
lines changed

8 files changed

+9099
-964
lines changed

‎lib/matplotlib/projections/polar.py

Lines changed: 273 additions & 78 deletions
Large diffs are not rendered by default.
Binary file not shown.

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

Lines changed: 864 additions & 886 deletions
Loading
Binary file not shown.

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

Lines changed: 7939 additions & 0 deletions
Loading

‎lib/matplotlib/tests/test_axes.py

Lines 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+
deftest_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+
fori,startinenumerate(theta_mins):
483+
forj,endinenumerate(theta_maxs):
484+
ax=axes[i,j]
485+
ifstart<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
deftest_axvspan_epoch():
472495
fromdatetimeimportdatetime

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp