Skip to content

Commit b96cbcf

Browse files
committed
supress warning from matlab style data labeling in tests
1 parent 7fb099d commit b96cbcf

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

lib/matplotlib/tests/test_axes.py

+26-26
Original file line numberDiff line numberDiff line change
@@ -116,22 +116,22 @@ def test_twinx_cla():
116116
ax2 = ax.twinx()
117117
ax3 = ax2.twiny()
118118
plt.draw()
119-
assert_false(ax2.xaxis.get_visible())
120-
assert_false(ax2.patch.get_visible())
119+
assert_false(ax2.xaxis.visible)
120+
assert_false(ax2.patch.visible)
121121
ax2.cla()
122122
ax3.cla()
123123

124-
assert_false(ax2.xaxis.get_visible())
125-
assert_false(ax2.patch.get_visible())
126-
assert_true(ax2.yaxis.get_visible())
124+
assert_false(ax2.xaxis.visible)
125+
assert_false(ax2.patch.visible)
126+
assert_true(ax2.yaxis.visible)
127127

128-
assert_true(ax3.xaxis.get_visible())
129-
assert_false(ax3.patch.get_visible())
130-
assert_false(ax3.yaxis.get_visible())
128+
assert_true(ax3.xaxis.visible)
129+
assert_false(ax3.patch.visible)
130+
assert_false(ax3.yaxis.visible)
131131

132-
assert_true(ax.xaxis.get_visible())
133-
assert_true(ax.patch.get_visible())
134-
assert_true(ax.yaxis.get_visible())
132+
assert_true(ax.xaxis.visible)
133+
assert_true(ax.patch.visible)
134+
assert_true(ax.yaxis.visible)
135135

136136

137137
@image_comparison(baseline_images=["minorticks_on_rcParams_both"], extensions=['png'])
@@ -219,7 +219,7 @@ def test_polar_coord_annotations():
219219
ax = fig.add_subplot(111, aspect='equal')
220220

221221
ax.add_artist(el)
222-
el.set_clip_box(ax.bbox)
222+
el.clipbox = ax.bbox
223223

224224
ax.annotate('the top',
225225
xy=(np.pi/2., 10.), # theta, radius
@@ -229,7 +229,7 @@ def test_polar_coord_annotations():
229229
arrowprops=dict(facecolor='black', shrink=0.05),
230230
horizontalalignment='left',
231231
verticalalignment='baseline',
232-
clip_on=True, # clip to the axes bounding box
232+
clipon=True, # clip to the axes bounding box
233233
)
234234

235235
ax.set_xlim(-20, 20)
@@ -518,7 +518,7 @@ def test_hexbin_extent():
518518

519519

520520
@image_comparison(baseline_images=['hexbin_empty'], remove_text=True,
521-
extensions=['png'])
521+
extensions=['png'])
522522
def test_hexbin_empty():
523523
# From #3886: creating hexbin from empty dataset raises ValueError
524524
ax = plt.gca()
@@ -638,7 +638,7 @@ def test_imshow_clip():
638638
c = ax.contour(r, [N/4])
639639
x = c.collections[0]
640640
clipPath = x.get_paths()[0]
641-
clipTransform = x.get_transform()
641+
clipTransform = x.transform
642642

643643
from matplotlib.transforms import TransformedPath
644644
clip_path = TransformedPath(clipPath, clipTransform)
@@ -1083,14 +1083,14 @@ def test_hist_log():
10831083
ax.hist(data, fill=False, log=True)
10841084

10851085
@image_comparison(baseline_images=['hist_bar_empty'], remove_text=True,
1086-
extensions=['png'])
1086+
extensions=['png'])
10871087
def test_hist_bar_empty():
10881088
# From #3886: creating hist from empty dataset raises ValueError
10891089
ax = plt.gca()
10901090
ax.hist([], histtype='bar')
10911091

10921092
@image_comparison(baseline_images=['hist_step_empty'], remove_text=True,
1093-
extensions=['png'])
1093+
extensions=['png'])
10941094
def test_hist_step_empty():
10951095
# From #3886: creating hist from empty dataset raises ValueError
10961096
ax = plt.gca()
@@ -3581,9 +3581,9 @@ def test_twin_spines():
35813581

35823582
def make_patch_spines_invisible(ax):
35833583
ax.set_frame_on(True)
3584-
ax.patch.set_visible(False)
3584+
ax.patch.visible = False
35853585
for sp in six.itervalues(ax.spines):
3586-
sp.set_visible(False)
3586+
sp.visible = False
35873587

35883588
fig = plt.figure(figsize=(4, 3))
35893589
fig.subplots_adjust(right=0.75)
@@ -3600,7 +3600,7 @@ def make_patch_spines_invisible(ax):
36003600
# and spines invisible.
36013601
make_patch_spines_invisible(par2)
36023602
# Second, show the right spine.
3603-
par2.spines["right"].set_visible(True)
3603+
par2.spines["right"].visible = True
36043604

36053605
p1, = host.plot([0, 1, 2], [0, 1, 2], "b-")
36063606
p2, = par1.plot([0, 1, 2], [0, 3, 2], "r-")
@@ -3643,14 +3643,14 @@ def test_twin_spines_on_top():
36433643
ax2.fill_between(data[0], data[1]/1E3, color='#7FC97F', alpha=.5)
36443644

36453645
# Reuse testcase from above for a labeled data test
3646-
data = {"x": data[0], "y": data[1]/1E3}
3646+
data = {"i": data[0], "j": data[1]/1E3}
36473647
fig = plt.figure()
36483648
ax1 = fig.add_subplot(1, 1, 1)
36493649
ax2 = ax1.twinx()
3650-
ax1.plot("x", "y", color='#BEAED4', data=data)
3651-
ax1.fill_between("x", "y", color='#BEAED4', alpha=.8, data=data)
3652-
ax2.plot("x", "y", color='#7FC97F', data=data)
3653-
ax2.fill_between("x", "y", color='#7FC97F', alpha=.5, data=data)
3650+
ax1.plot("i", "j", color='#BEAED4', data=data)
3651+
ax1.fill_between("i", "j", color='#BEAED4', alpha=.8, data=data)
3652+
ax2.plot("i", "j", color='#7FC97F', data=data)
3653+
ax2.fill_between("i", "j", color='#7FC97F', alpha=.5, data=data)
36543654

36553655

36563656
@cleanup
@@ -3715,7 +3715,7 @@ def test_relim_visible_only():
37153715
l = ax.plot(x2, y2)
37163716
assert ax.get_xlim() == x2
37173717
assert ax.get_ylim() == y2
3718-
l[0].set_visible(False)
3718+
l[0].visible = False
37193719
assert ax.get_xlim() == x2
37203720
assert ax.get_ylim() == y2
37213721

0 commit comments

Comments
 (0)