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

Skip to content

Commit 1a2a4ca

Browse files
committed
MEP10 axhline and axvline are now in numpydoc format
1 parent 1668411 commit 1a2a4ca

File tree

1 file changed

+51
-38
lines changed

1 file changed

+51
-38
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 51 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -596,31 +596,40 @@ def axhline(self, y=0, xmin=0, xmax=1, **kwargs):
596596
"""
597597
Add a horizontal line across the axis.
598598
599-
Call signature::
599+
Parameters
600+
----------
601+
y : scalar, optional, default: 0
602+
y position in data coordinates of the horizontal line.
603+
604+
xmin : scalar, optional, default: 0
605+
Should be between 0 and 1, 0 being the far left of the plot, 1 the
606+
far right of the plot.
600607
601-
axhline(y=0, xmin=0, xmax=1, **kwargs)
608+
xmax : scalar, optional, default: 1
609+
Should be between 0 and 1, 0 being the far left of the plot, 1 the
610+
far right of the plot.
602611
603-
Draw a horizontal line at *y* from *xmin* to *xmax*. With the
604-
default values of *xmin* = 0 and *xmax* = 1, this line will
605-
always span the horizontal extent of the axes, regardless of
606-
the xlim settings, even if you change them, e.g., with the
607-
:meth:`set_xlim` command. That is, the horizontal extent is
608-
in axes coords: 0=left, 0.5=middle, 1.0=right but the *y*
609-
location is in data coordinates.
612+
Returns
613+
-------
614+
`~matplotlib.lines.Line2D`
610615
611-
Return value is the :class:`~matplotlib.lines.Line2D`
612-
instance. kwargs are the same as kwargs to plot, and can be
616+
Notes
617+
-----
618+
kwargs are the same as kwargs to plot, and can be
613619
used to control the line properties. e.g.,
614620
615-
* draw a thick red hline at *y* = 0 that spans the xrange::
621+
Examples
622+
--------
623+
624+
* draw a thick red hline at 'y' = 0 that spans the xrange::
616625
617626
>>> axhline(linewidth=4, color='r')
618627
619-
* draw a default hline at *y* = 1 that spans the xrange::
628+
* draw a default hline at 'y' = 1 that spans the xrange::
620629
621630
>>> axhline(y=1)
622631
623-
* draw a default hline at *y* = .5 that spans the the middle half of
632+
* draw a default hline at 'y' = .5 that spans the the middle half of
624633
the xrange::
625634
626635
>>> axhline(y=.5, xmin=0.25, xmax=0.75)
@@ -630,10 +639,9 @@ def axhline(self, y=0, xmin=0, xmax=1, **kwargs):
630639
631640
%(Line2D)s
632641
633-
.. seealso::
634-
635-
:meth:`axhspan`
636-
for example plot and source code
642+
See also
643+
--------
644+
`axhspan` for example plot and source code
637645
"""
638646

639647
if "transform" in kwargs:
@@ -660,22 +668,26 @@ def axvline(self, x=0, ymin=0, ymax=1, **kwargs):
660668
"""
661669
Add a vertical line across the axes.
662670
663-
Call signature::
671+
Parameters
672+
----------
673+
x : scalar, optional, default: 0
674+
y position in data coordinates of the vertical line.
664675
665-
axvline(x=0, ymin=0, ymax=1, **kwargs)
676+
ymin : scalar, optional, default: 0
677+
Should be between 0 and 1, 0 being the far left of the plot, 1 the
678+
far right of the plot.
666679
667-
Draw a vertical line at *x* from *ymin* to *ymax*. With the
668-
default values of *ymin* = 0 and *ymax* = 1, this line will
669-
always span the vertical extent of the axes, regardless of the
670-
ylim settings, even if you change them, e.g., with the
671-
:meth:`set_ylim` command. That is, the vertical extent is in
672-
axes coords: 0=bottom, 0.5=middle, 1.0=top but the *x* location
673-
is in data coordinates.
680+
ymax : scalar, optional, default: 1
681+
Should be between 0 and 1, 0 being the far left of the plot, 1 the
682+
far right of the plot.
683+
684+
Returns
685+
-------
686+
`~matplotlib.lines.Line2D`
674687
675-
Return value is the :class:`~matplotlib.lines.Line2D`
676-
instance. kwargs are the same as kwargs to plot, and can be
677-
used to control the line properties. e.g.,
678688
689+
Examples
690+
---------
679691
* draw a thick red vline at *x* = 0 that spans the yrange::
680692
681693
>>> axvline(linewidth=4, color='r')
@@ -694,10 +706,10 @@ def axvline(self, x=0, ymin=0, ymax=1, **kwargs):
694706
695707
%(Line2D)s
696708
697-
.. seealso::
709+
See also
710+
--------
698711
699-
:meth:`axhspan`
700-
for example plot and source code
712+
`axhspan` for example plot and source code
701713
"""
702714

703715
if "transform" in kwargs:
@@ -920,7 +932,7 @@ def hlines(self, y, xmin, xmax, colors='k', linestyles='solid',
920932

921933
@docstring.dedent_interpd
922934
def vlines(self, x, ymin, ymax, colors='k', linestyles='solid',
923-
label='', **kwargs):
935+
label='', **kwargs):
924936
"""
925937
Plot vertical lines.
926938
@@ -2379,7 +2391,7 @@ def pie(self, x, explode=None, labels=None, colors=None,
23792391
y += expl * math.sin(thetam)
23802392

23812393
w = mpatches.Wedge((x, y), radius, 360. * theta1, 360. * theta2,
2382-
facecolor=colors[i % len(colors)])
2394+
facecolor=colors[i % len(colors)])
23832395
slices.append(w)
23842396
self.add_patch(w)
23852397
w.set_label(label)
@@ -2388,9 +2400,10 @@ def pie(self, x, explode=None, labels=None, colors=None,
23882400
# make sure to add a shadow after the call to
23892401
# add_patch so the figure and transform props will be
23902402
# set
2391-
shad = mpatches.Shadow(w, -0.02, -0.02,
2392-
#props={'facecolor':w.get_facecolor()}
2393-
)
2403+
shad = mpatches.Shadow(
2404+
w, -0.02, -0.02,
2405+
#props={'facecolor':w.get_facecolor()}
2406+
)
23942407
shad.set_zorder(0.9 * w.get_zorder())
23952408
shad.set_label('_nolegend_')
23962409
self.add_patch(shad)

0 commit comments

Comments
 (0)