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

Skip to content

Commit bdcafbc

Browse files
committed
Add test for axisline_style
1 parent 7de767e commit bdcafbc

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

lib/mpl_toolkits/axisartist/axisline_style.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ def set_path(self, path):
5454
def draw(self, renderer):
5555
"""
5656
Draw the axis line.
57-
1) transform the path to the display coordinate.
58-
2) extend the path to make a room for arrow
59-
3) update the path of the FancyArrowPatch.
60-
4) draw
57+
1) Transform the path to the display coordinate.
58+
2) Extend the path to make a room for arrow.
59+
3) Update the path of the FancyArrowPatch.
60+
4) Draw.
6161
"""
6262
path_in_disp = self._line_transform.transform_path(self._line_path)
6363
mutation_size = self.get_mutation_scale() # line_mutation_scale()
@@ -67,7 +67,7 @@ def draw(self, renderer):
6767
FancyArrowPatch.draw(self, renderer)
6868

6969
class FilledArrow(SimpleArrow):
70-
"""The artist class that will be returned for SimpleArrow style."""
70+
"""The artist class that will be returned for FilledArrow style."""
7171
_ARROW_STYLE = "-|>"
7272

7373

lib/mpl_toolkits/tests/test_axisartist_axislines.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from matplotlib.testing.decorators import image_comparison
44
from matplotlib.transforms import IdentityTransform
55

6-
from mpl_toolkits.axisartist.axislines import SubplotZero, Subplot
6+
from mpl_toolkits.axisartist.axislines import AxesZero, SubplotZero, Subplot
77
from mpl_toolkits.axisartist import Axes, SubplotHost
88

99

@@ -90,3 +90,16 @@ def test_ParasiteAxesAuxTrans():
9090
ax1.set_ylim((0, 5))
9191

9292
ax2.contour(xx, yy, data, colors='k')
93+
94+
95+
@image_comparison(['axisline_style.png'], remove_text=True, style='mpl20')
96+
def test_axisline_style():
97+
fig = plt.figure(figsize=(2, 2))
98+
ax = fig.add_subplot(axes_class=AxesZero)
99+
ax.axis["xzero"].set_axisline_style("-|>,size=3.0")
100+
ax.axis["xzero"].set_visible(True)
101+
ax.axis["yzero"].set_axisline_style("->")
102+
ax.axis["yzero"].set_visible(True)
103+
104+
for direction in ("left", "right", "bottom", "top"):
105+
ax.axis[direction].set_visible(False)

0 commit comments

Comments
 (0)