Skip to content

Commit c002b07

Browse files
abhinuvpitaleMeeseeksDev[bot]
authored andcommitted
Backport PR #12261: FIX: parasite axis2 demo
1 parent b63b04b commit c002b07

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

lib/mpl_toolkits/axisartist/axis_artist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def draw(self, renderer):
301301

302302
for loc, angle in self.locs_angles:
303303
marker_rotation.clear().rotate_deg(angle+add_angle)
304-
locs = path_trans.transform_non_affine([loc])
304+
locs = path_trans.transform_non_affine(np.array([loc]))
305305
if self.axes and not self.axes.viewLim.contains(*locs[0]):
306306
continue
307307
renderer.draw_markers(gc, self._tickvert_path, marker_transform,

lib/mpl_toolkits/tests/test_axisartist_axislines.py

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

55
from mpl_toolkits.axisartist.axislines import SubplotZero, Subplot
66

7+
from mpl_toolkits.axisartist import Axes
8+
79

810
@image_comparison(baseline_images=['SubplotZero'],
911
extensions=['png'], style='default')
@@ -40,3 +42,14 @@ def test_Subplot():
4042
ax.axis["bottom"].major_ticks.set_tick_out(True)
4143

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

0 commit comments

Comments
 (0)