Skip to content

Commit 56609e5

Browse files
Backport PR #12261: FIX: parasite axis2 demo
1 parent 4ddc68a commit 56609e5

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

lib/mpl_toolkits/axisartist/axis_artist.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,8 @@ def draw(self, renderer):
327327

328328
for loc, angle in self.locs_angles:
329329
marker_rotation.clear().rotate_deg(angle+add_angle)
330-
locs = path_trans.transform_non_affine([loc])
331-
if (self.axes and
332-
not self.axes.viewLim.contains(locs[0][0], locs[0][1])):
330+
locs = path_trans.transform_non_affine(np.array([loc]))
331+
if self.axes and not self.axes.viewLim.contains(*locs[0]):
333332
continue
334333
renderer.draw_markers(gc, self._tickvert_path, marker_transform,
335334
Path(locs), path_trans.get_affine())

lib/mpl_toolkits/tests/test_axisartist_axislines.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
from mpl_toolkits.axisartist.axislines import SubplotZero, Subplot
99

10+
from mpl_toolkits.axisartist import Axes
11+
1012

1113
@image_comparison(baseline_images=['SubplotZero'],
1214
extensions=['png'], style='default')
@@ -43,3 +45,14 @@ def test_Subplot():
4345
ax.axis["bottom"].major_ticks.set_tick_out(True)
4446

4547
ax.axis["bottom"].set_label("Tk0")
48+
49+
50+
def test_Axes():
51+
fig = plt.figure()
52+
ax = Axes(fig, [0.15, 0.1, 0.65, 0.8])
53+
fig.add_axes(ax)
54+
ax.plot([1, 2, 3], [0, 1, 2])
55+
56+
ax.set_xscale('log')
57+
58+
plt.show()

0 commit comments

Comments
 (0)