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

Commitee2d046

Browse files
authored
Merge pull request#17195 from anntzer/polartests
Fix polar tests.
2 parents7f670ed +ba4d740 commitee2d046

File tree

3 files changed

+16
-24
lines changed

3 files changed

+16
-24
lines changed

‎lib/matplotlib/projections/polar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ def set_thetalim(self, *args, **kwargs):
10611061

10621062
ifthetaminisnotNoneandthetamaxisnotNone:
10631063
ifabs(thetamax-thetamin)>2*np.pi:
1064-
raiseValueError('The angle range must be<= 360 degrees')
1064+
raiseValueError('The angle range must be<= 360 degrees')
10651065
returntuple(np.rad2deg(self.set_xlim(left=left,right=right,
10661066
xmin=thetamin,xmax=thetamax)))
10671067

‎lib/matplotlib/tests/test_polar.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
importnumpyasnp
2+
importpytest
3+
4+
frommatplotlibimportpyplotasplt
5+
6+
7+
deftest_thetalim_valid_invalid():
8+
ax=plt.subplot(projection='polar')
9+
ax.set_thetalim(0,2*np.pi)# doesn't raise.
10+
ax.set_thetalim(thetamin=800,thetamax=440)# doesn't raise.
11+
withpytest.raises(ValueError,match='The angle range must be <= 2 pi'):
12+
ax.set_thetalim(0,3*np.pi)
13+
withpytest.raises(ValueError,
14+
match='The angle range must be <= 360 degrees'):
15+
ax.set_thetalim(thetamin=800,thetamax=400)

‎lib/matplotlib/tests/test_subplots.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -173,26 +173,3 @@ def test_dont_mutate_kwargs():
173173
gridspec_kw=gridspec_kw)
174174
assertsubplot_kw== {'sharex':'all'}
175175
assertgridspec_kw== {'width_ratios': [1,2]}
176-
177-
178-
deftest_subplot_theta_min_max_raise():
179-
withpytest.raises(ValueError,match='The angle range '+
180-
'must be<= 360 degrees'):
181-
ax=plt.subplot(111,projection='polar')
182-
ax.set_thetalim(thetamin=800,thetamax=400)
183-
184-
185-
deftest_subplot_theta_min_max_non_raise():
186-
ax=plt.subplot(111,projection='polar')
187-
ax.set_thetalim(thetamin=800,thetamax=440)
188-
189-
190-
deftest_subplot_theta_range_raise():
191-
withpytest.raises(ValueError,match='The angle range must be <= 2 pi'):
192-
ax=plt.subplot(111,projection='polar')
193-
ax.set_thetalim(0,3*numpy.pi)
194-
195-
196-
deftest_subplot_theta_range_normal_non_raise():
197-
ax=plt.subplot(111,projection='polar')
198-
ax.set_thetalim(0,2*numpy.pi)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp