@@ -596,31 +596,40 @@ def axhline(self, y=0, xmin=0, xmax=1, **kwargs):
596
596
"""
597
597
Add a horizontal line across the axis.
598
598
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.
600
607
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.
602
611
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`
610
615
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
613
619
used to control the line properties. e.g.,
614
620
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::
616
625
617
626
>>> axhline(linewidth=4, color='r')
618
627
619
- * draw a default hline at *y* = 1 that spans the xrange::
628
+ * draw a default hline at 'y' = 1 that spans the xrange::
620
629
621
630
>>> axhline(y=1)
622
631
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
624
633
the xrange::
625
634
626
635
>>> axhline(y=.5, xmin=0.25, xmax=0.75)
@@ -630,10 +639,9 @@ def axhline(self, y=0, xmin=0, xmax=1, **kwargs):
630
639
631
640
%(Line2D)s
632
641
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
637
645
"""
638
646
639
647
if "transform" in kwargs :
@@ -660,22 +668,26 @@ def axvline(self, x=0, ymin=0, ymax=1, **kwargs):
660
668
"""
661
669
Add a vertical line across the axes.
662
670
663
- Call signature::
671
+ Parameters
672
+ ----------
673
+ x : scalar, optional, default: 0
674
+ y position in data coordinates of the vertical line.
664
675
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.
666
679
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`
674
687
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.,
678
688
689
+ Examples
690
+ ---------
679
691
* draw a thick red vline at *x* = 0 that spans the yrange::
680
692
681
693
>>> axvline(linewidth=4, color='r')
@@ -694,10 +706,10 @@ def axvline(self, x=0, ymin=0, ymax=1, **kwargs):
694
706
695
707
%(Line2D)s
696
708
697
- .. seealso::
709
+ See also
710
+ --------
698
711
699
- :meth:`axhspan`
700
- for example plot and source code
712
+ `axhspan` for example plot and source code
701
713
"""
702
714
703
715
if "transform" in kwargs :
@@ -920,7 +932,7 @@ def hlines(self, y, xmin, xmax, colors='k', linestyles='solid',
920
932
921
933
@docstring .dedent_interpd
922
934
def vlines (self , x , ymin , ymax , colors = 'k' , linestyles = 'solid' ,
923
- label = '' , ** kwargs ):
935
+ label = '' , ** kwargs ):
924
936
"""
925
937
Plot vertical lines.
926
938
@@ -2379,7 +2391,7 @@ def pie(self, x, explode=None, labels=None, colors=None,
2379
2391
y += expl * math .sin (thetam )
2380
2392
2381
2393
w = mpatches .Wedge ((x , y ), radius , 360. * theta1 , 360. * theta2 ,
2382
- facecolor = colors [i % len (colors )])
2394
+ facecolor = colors [i % len (colors )])
2383
2395
slices .append (w )
2384
2396
self .add_patch (w )
2385
2397
w .set_label (label )
@@ -2388,9 +2400,10 @@ def pie(self, x, explode=None, labels=None, colors=None,
2388
2400
# make sure to add a shadow after the call to
2389
2401
# add_patch so the figure and transform props will be
2390
2402
# 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
+ )
2394
2407
shad .set_zorder (0.9 * w .get_zorder ())
2395
2408
shad .set_label ('_nolegend_' )
2396
2409
self .add_patch (shad )
0 commit comments