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

Skip to content

Commit f55f98a

Browse files
committed
Add test for #7617
1 parent 89b2d4f commit f55f98a

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

lib/mpl_toolkits/axisartist/tests/test_axislines.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -135,21 +135,16 @@ def test_axisline_style_tight():
135135
fig.tight_layout()
136136

137137

138-
@image_comparison(['subplotzero_ylabel.png'], style='mpl20')
138+
@image_comparison(['subplotzero_ylabel.png'])
139139
def test_subplotzero_ylabel():
140140
fig = plt.figure()
141-
ax = SubplotZero(fig, 111)
142-
_ = fig.add_subplot(ax)
141+
ax = fig.add_subplot(111, axes_class=SubplotZero)
143142

144-
for direction in ["xzero", "yzero"]:
145-
ax.axis[direction].set_visible(True)
146-
ax.axis[direction].set_axisline_style("->")
147-
# Set outward ticks
148-
ax.axis[direction].major_ticks.set_tick_out(True)
149-
ax.axis[direction].minor_ticks.set_tick_out(True)
143+
ax.set(xlim=(-3, 7), ylim=(-3, 7), xlabel="x", ylabel="y")
150144

151-
ax.axis["yzero"].set_axis_direction("left")
145+
zero_axis = ax.axis["xzero", "yzero"]
146+
zero_axis.set_visible(True) # they are hidden by default
152147

153-
plt.plot([0, 1], [0, 1], c="blue", lw=2)
154-
plt.xlabel('x')
155-
plt.ylabel('y')
148+
ax.axis["left", "right", "bottom", "top"].set_visible(False)
149+
150+
zero_axis.set_axisline_style("->")

0 commit comments

Comments
 (0)