Skip to content

Commit 164a28c

Browse files
committed
Add test for #7617
1 parent 677775c commit 164a28c

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

lib/mpl_toolkits/axisartist/axisline_style.py

+1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ def __init__(self, size=1):
147147
super().__init__()
148148

149149
def new_line(self, axis_artist, transform):
150+
150151
linepath = Path([(0, 0), (0, 1)])
151152
axisline = self.ArrowAxisClass(axis_artist, linepath, transform,
152153
line_mutation_scale=self.size)

lib/mpl_toolkits/axisartist/tests/test_axislines.py

+7-12
Original file line numberDiff line numberDiff line change
@@ -138,18 +138,13 @@ def test_axisline_style_tight():
138138
@image_comparison(['subplotzero_ylabel.png'], style='mpl20')
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)