Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9c49521

Browse files
committed
Remove gca() warning from test_axes
1 parent 3208322 commit 9c49521

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
from __future__ import absolute_import, division, print_function
2-
3-
import six
41
from itertools import chain, product
52
from distutils.version import LooseVersion
63
import io
@@ -602,14 +599,14 @@ def test_const_xy():
602599
style='default')
603600
def test_polar_wrap():
604601
fig = plt.figure()
605-
plt.subplot(111, polar=True)
602+
plt.subplot(111, polar=True, label='First axes')
606603
plt.polar(np.deg2rad([179, -179]), [0.2, 0.1], "b.-")
607-
plt.polar(np.deg2rad([179, 181]), [0.2, 0.1], "g.-")
604+
plt.polar(np.deg2rad([179, 181]), [0.2, 0.1], "g.-")
608605
plt.rgrids([0.05, 0.1, 0.15, 0.2, 0.25, 0.3])
609606
assert len(fig.axes) == 1, 'More than one polar axes created.'
610607

611608
fig = plt.figure()
612-
plt.subplot(111, polar=True)
609+
plt.subplot(111, polar=True, label='Second axes')
613610
plt.polar(np.deg2rad([2, -2]), [0.2, 0.1], "b.-")
614611
plt.polar(np.deg2rad([2, 358]), [0.2, 0.1], "g.-")
615612
plt.polar(np.deg2rad([358, 2]), [0.2, 0.1], "r.-")
@@ -705,11 +702,10 @@ def test_polar_rlabel_position():
705702
ax.tick_params(rotation='auto')
706703

707704

708-
@image_comparison(baseline_images=['polar_theta_wedge'], style='default',
709-
tol=0.01 if six.PY2 else 0)
705+
@image_comparison(baseline_images=['polar_theta_wedge'], style='default')
710706
def test_polar_theta_limits():
711707
r = np.arange(0, 3.0, 0.01)
712-
theta = 2*np.pi*r
708+
theta = 2 * np.pi * r
713709

714710
theta_mins = np.arange(15.0, 361.0, 90.0)
715711
theta_maxs = np.arange(50.0, 361.0, 90.0)
@@ -4329,7 +4325,7 @@ def test_twin_spines():
43294325
def make_patch_spines_invisible(ax):
43304326
ax.set_frame_on(True)
43314327
ax.patch.set_visible(False)
4332-
for sp in six.itervalues(ax.spines):
4328+
for sp in ax.spines.values:
43334329
sp.set_visible(False)
43344330

43354331
fig = plt.figure(figsize=(4, 3))

0 commit comments

Comments
 (0)