From 310a2ef0528240174696cd71cc5b6c1fa0f076a5 Mon Sep 17 00:00:00 2001 From: Abhinuv Nitin Pitale Date: Mon, 24 Sep 2018 21:55:34 -0700 Subject: [PATCH 1/5] update to fix #12208,typecasted locs to np array --- lib/mpl_toolkits/axisartist/axis_artist.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mpl_toolkits/axisartist/axis_artist.py b/lib/mpl_toolkits/axisartist/axis_artist.py index 2aea9878147f..9c7730895250 100644 --- a/lib/mpl_toolkits/axisartist/axis_artist.py +++ b/lib/mpl_toolkits/axisartist/axis_artist.py @@ -287,7 +287,7 @@ def draw(self, renderer): for loc, angle in self.locs_angles: marker_rotation.clear().rotate_deg(angle+add_angle) - locs = path_trans.transform_non_affine([loc]) + locs = path_trans.transform_non_affine(np.array([loc])) if self.axes and not self.axes.viewLim.contains(*locs[0]): continue renderer.draw_markers(gc, self._tickvert_path, marker_transform, From d6ab510d8f43fbd064dabc073a24d79a6a5c953d Mon Sep 17 00:00:00 2001 From: Abhinuv Nitin Pitale Date: Mon, 24 Sep 2018 22:02:04 -0700 Subject: [PATCH 2/5] added test for #12208 --- .../tests/test_axisartist_axislines.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/mpl_toolkits/tests/test_axisartist_axislines.py b/lib/mpl_toolkits/tests/test_axisartist_axislines.py index 4a4b82cd2796..d79e3da3b107 100644 --- a/lib/mpl_toolkits/tests/test_axisartist_axislines.py +++ b/lib/mpl_toolkits/tests/test_axisartist_axislines.py @@ -4,6 +4,8 @@ from mpl_toolkits.axisartist.axislines import SubplotZero, Subplot +from mpl_toolkits.axisartist import Axes + @image_comparison(baseline_images=['SubplotZero'], extensions=['png'], style='default') @@ -40,3 +42,17 @@ def test_Subplot(): ax.axis["bottom"].major_ticks.set_tick_out(True) ax.axis["bottom"].set_label("Tk0") + + +@image_comparison(baseline_images=['Subplot'], + extensions=['png'], style='default') +def test_Axes(): + + fig = plt.figure() + ax = Axes(fig, [0.15, 0.1, 0.65, 0.8]) + fig.add_axes(ax) + ax.plot([1, 2, 3], [0, 1, 2]) + + ax.set_xscale('log') + + plt.show() From 5713268bddd892e52580aa2a2418203790c5abb8 Mon Sep 17 00:00:00 2001 From: Abhinuv Nitin Pitale Date: Tue, 25 Sep 2018 10:37:49 -0700 Subject: [PATCH 3/5] Update test_axisartist_axislines.py --- lib/mpl_toolkits/tests/test_axisartist_axislines.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/mpl_toolkits/tests/test_axisartist_axislines.py b/lib/mpl_toolkits/tests/test_axisartist_axislines.py index d79e3da3b107..5ef58cfc13ad 100644 --- a/lib/mpl_toolkits/tests/test_axisartist_axislines.py +++ b/lib/mpl_toolkits/tests/test_axisartist_axislines.py @@ -44,8 +44,6 @@ def test_Subplot(): ax.axis["bottom"].set_label("Tk0") -@image_comparison(baseline_images=['Subplot'], - extensions=['png'], style='default') def test_Axes(): fig = plt.figure() From 36b2b3c6d0c3d9bebd297fec5de0c92fd1c83910 Mon Sep 17 00:00:00 2001 From: Abhinuv Nitin Pitale Date: Tue, 25 Sep 2018 10:38:15 -0700 Subject: [PATCH 4/5] Update test_axisartist_axislines.py --- lib/mpl_toolkits/tests/test_axisartist_axislines.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/mpl_toolkits/tests/test_axisartist_axislines.py b/lib/mpl_toolkits/tests/test_axisartist_axislines.py index 5ef58cfc13ad..f2c80027f397 100644 --- a/lib/mpl_toolkits/tests/test_axisartist_axislines.py +++ b/lib/mpl_toolkits/tests/test_axisartist_axislines.py @@ -44,8 +44,7 @@ def test_Subplot(): ax.axis["bottom"].set_label("Tk0") -def test_Axes(): - +def test_Axes(): fig = plt.figure() ax = Axes(fig, [0.15, 0.1, 0.65, 0.8]) fig.add_axes(ax) From b06eddf04776d5acafad12a684b0b21815bed450 Mon Sep 17 00:00:00 2001 From: Abhinuv Nitin Pitale Date: Tue, 25 Sep 2018 13:27:28 -0700 Subject: [PATCH 5/5] flake8 corrections --- lib/mpl_toolkits/tests/test_axisartist_axislines.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/mpl_toolkits/tests/test_axisartist_axislines.py b/lib/mpl_toolkits/tests/test_axisartist_axislines.py index f2c80027f397..4bf67b4b0df7 100644 --- a/lib/mpl_toolkits/tests/test_axisartist_axislines.py +++ b/lib/mpl_toolkits/tests/test_axisartist_axislines.py @@ -42,9 +42,9 @@ def test_Subplot(): ax.axis["bottom"].major_ticks.set_tick_out(True) ax.axis["bottom"].set_label("Tk0") - -def test_Axes(): + +def test_Axes(): fig = plt.figure() ax = Axes(fig, [0.15, 0.1, 0.65, 0.8]) fig.add_axes(ax)