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

Skip to content

Commit 4ac0dd1

Browse files
committed
improve Axes.pie docstring
1 parent 51d3796 commit 4ac0dd1

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2517,30 +2517,32 @@ def pie(self, x, explode=None, labels=None, colors=None,
25172517
startangle=None, radius=None, counterclock=True,
25182518
wedgeprops=None, textprops=None, center=(0, 0),
25192519
frame=False, rotatelabels=False):
2520-
r"""
2520+
"""
25212521
Plot a pie chart.
25222522
2523-
Make a pie chart of array *x*. The fractional area of each
2524-
wedge is given by ``x/sum(x)``. If ``sum(x) <= 1``, then the
2525-
values of x give the fractional area directly and the array
2526-
will not be normalized. The wedges are plotted
2527-
counterclockwise, by default starting from the x-axis.
2523+
Make a pie chart of array *x*. The fractional area of each wedge is
2524+
given by ``x/sum(x)``. If ``sum(x) < 1``, then the values of *x* give
2525+
the fractional area directly and the array will not be normalized. The
2526+
resulting pie will have an empty wedge of size ``1 - sum(x)``.
2527+
2528+
The wedges are plotted counterclockwise, by default starting from the
2529+
x-axis.
25282530
25292531
Parameters
25302532
----------
25312533
x : array-like
2532-
The input array used to make the pie chart.
2534+
The wedge sizes.
25332535
25342536
explode : array-like, optional, default: None
2535-
If not *None*, is a ``len(x)`` array which specifies the
2536-
fraction of the radius with which to offset each wedge.
2537+
If not *None*, is a ``len(x)`` array which specifies the fraction
2538+
of the radius with which to offset each wedge.
25372539
25382540
labels : list, optional, default: None
25392541
A sequence of strings providing the labels for each wedge
25402542
25412543
colors : array-like, optional, default: None
25422544
A sequence of matplotlib color args through which the pie chart
2543-
will cycle. If `None`, will use the colors in the currently
2545+
will cycle. If *None*, will use the colors in the currently
25442546
active cycle.
25452547
25462548
autopct : None (default), string, or function, optional
@@ -2550,9 +2552,8 @@ def pie(self, x, explode=None, labels=None, colors=None,
25502552
If it is a function, it will be called.
25512553
25522554
pctdistance : float, optional, default: 0.6
2553-
The ratio between the center of each pie slice and the
2554-
start of the text generated by *autopct*. Ignored if
2555-
*autopct* is *None*.
2555+
The ratio between the center of each pie slice and the start of
2556+
the text generated by *autopct*. Ignored if *autopct* is *None*.
25562557
25572558
shadow : bool, optional, default: False
25582559
Draw a shadow beneath the pie.
@@ -2572,7 +2573,7 @@ def pie(self, x, explode=None, labels=None, colors=None,
25722573
25732574
wedgeprops : dict, optional, default: None
25742575
Dict of arguments passed to the wedge objects making the pie.
2575-
For example, you can pass in``wedgeprops = {'linewidth': 3}``
2576+
For example, you can pass in ``wedgeprops = {'linewidth': 3}``
25762577
to set the width of the wedge border lines equal to 3.
25772578
For more details, look at the doc/arguments of the wedge object.
25782579
By default ``clip_on=False``.
@@ -2581,8 +2582,8 @@ def pie(self, x, explode=None, labels=None, colors=None,
25812582
Dict of arguments to pass to the text objects.
25822583
25832584
center : list of float, optional, default: (0, 0)
2584-
Center position of the chart. Takes value (0, 0) or is a
2585-
sequence of 2 scalars.
2585+
Center position of the chart. Takes value (0, 0) or is a sequence
2586+
of 2 scalars.
25862587
25872588
frame : bool, optional, default: False
25882589
Plot axes frame with the chart if true.
@@ -2596,11 +2597,11 @@ def pie(self, x, explode=None, labels=None, colors=None,
25962597
A sequence of :class:`matplotlib.patches.Wedge` instances
25972598
25982599
texts : list
2599-
A is a list of the label :class:`matplotlib.text.Text` instances.
2600+
A list of the label :class:`matplotlib.text.Text` instances.
26002601
26012602
autotexts : list
2602-
A is a list of :class:`~matplotlib.text.Text` instances for the
2603-
numeric labels. Is returned only if parameter *autopct* is
2603+
A list of :class:`~matplotlib.text.Text` instances for the numeric
2604+
labels. This will only be returned if the parameter *autopct* is
26042605
not *None*.
26052606
26062607
Notes

0 commit comments

Comments
 (0)