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 bc7b7a6

Browse filesBrowse files
authored
Merge pull request #13496 from meeseeksmachine/auto-backport-of-pr-13465-on-v3.1.x
Backport PR #13465 on branch v3.1.x (FIX: polar set_rlim allow bottom-only call)
2 parents 24b8866 + 71c968b commit bc7b7a6
Copy full SHA for bc7b7a6

File tree

Expand file treeCollapse file tree

2 files changed

+23
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+23
-3
lines changed

‎lib/matplotlib/projections/polar.py

Copy file name to clipboardExpand all lines: lib/matplotlib/projections/polar.py
+2-3Lines 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-
if top is None and len(bottom) == 2:
1193-
top = bottom[1]
1194-
bottom = bottom[0]
1192+
if top is None and np.iterable(bottom):
1193+
bottom, top = bottom[0], bottom[1]
11951194

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

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+21Lines 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+
def test_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+
def test_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
def test_axvspan_epoch():
800821
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.