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

Commit7dca1bf

Browse files
authored
Merge pull request#13465 from jklymak/fix-polar-bottom
FIX: polar set_rlim allow bottom-only call
2 parentsed1d8dd +907067a commit7dca1bf

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

‎lib/matplotlib/projections/polar.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,9 +1189,8 @@ def set_ylim(self, bottom=None, top=None, emit=True, auto=False,
11891189
'argument and kwarg "ymax"')
11901190
else:
11911191
top=ymax
1192-
iftopisNoneandlen(bottom)==2:
1193-
top=bottom[1]
1194-
bottom=bottom[0]
1192+
iftopisNoneandnp.iterable(bottom):
1193+
bottom,top=bottom[0],bottom[1]
11951194

11961195
returnsuper().set_ylim(bottom=bottom,top=top,emit=emit,auto=auto)
11971196

‎lib/matplotlib/tests/test_axes.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,27 @@ def test_polar_theta_limits():
795795
ax.yaxis.set_tick_params(label2On=True,rotation='auto')
796796

797797

798+
@check_figures_equal(extensions=["png"])
799+
deftest_polar_rlim(fig_test,fig_ref):
800+
ax=fig_test.subplots(subplot_kw={'polar':True})
801+
ax.set_rlim(top=10)
802+
ax.set_rlim(bottom=.5)
803+
804+
ax=fig_ref.subplots(subplot_kw={'polar':True})
805+
ax.set_rmax(10.)
806+
ax.set_rmin(.5)
807+
808+
809+
@check_figures_equal(extensions=["png"])
810+
deftest_polar_rlim_bottom(fig_test,fig_ref):
811+
ax=fig_test.subplots(subplot_kw={'polar':True})
812+
ax.set_rlim(bottom=[.5,10])
813+
814+
ax=fig_ref.subplots(subplot_kw={'polar':True})
815+
ax.set_rmax(10.)
816+
ax.set_rmin(.5)
817+
818+
798819
@image_comparison(baseline_images=['axvspan_epoch'])
799820
deftest_axvspan_epoch():
800821
fromdatetimeimportdatetime

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp