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

Skip to content

Commit 0520035

Browse files
authored
Merge pull request #19175 from dstansby/float-ax-dir
2 parents 6d6dd38 + e434d1c commit 0520035

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/mpl_toolkits/axisartist/axislines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ def new_floating_axis(self, nth_coord, value,
411411
_helper = AxisArtistHelperRectlinear.Floating(
412412
axes, nth_coord, value, axis_direction)
413413

414-
axisline = AxisArtist(axes, _helper)
414+
axisline = AxisArtist(axes, _helper, axis_direction=axis_direction)
415415

416416
axisline.line.set_clip_on(True)
417417
axisline.line.set_clip_box(axisline.axes.bbox)

lib/mpl_toolkits/tests/test_axisartist_floating_axes.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,13 @@ def test_curvelinear4():
118118
ax2.scatter(xx, yy)
119119
l, = ax2.plot(xx, yy, "k-")
120120
l.set_clip_path(ax1.patch)
121+
122+
123+
def test_axis_direction():
124+
# Check that axis direction is propagated on a floating axis
125+
fig = plt.figure()
126+
ax = Subplot(fig, 111)
127+
fig.add_subplot(ax)
128+
ax.axis['y'] = ax.new_floating_axis(nth_coord=1, value=0,
129+
axis_direction='left')
130+
assert ax.axis['y']._axis_direction == 'left'

0 commit comments

Comments
 (0)