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

Skip to content

Commit 0111026

Browse files
authored
Merge pull request #10176 from matplotlib/auto-backport-of-pr-10150
Backport PR #10150 on branch v2.1.x
2 parents dc4a8d1 + 67d1ec6 commit 0111026

File tree

1 file changed

+37
-35
lines changed

1 file changed

+37
-35
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2462,30 +2462,32 @@ def pie(self, x, explode=None, labels=None, colors=None,
24622462
startangle=None, radius=None, counterclock=True,
24632463
wedgeprops=None, textprops=None, center=(0, 0),
24642464
frame=False, rotatelabels=False):
2465-
r"""
2465+
"""
24662466
Plot a pie chart.
24672467
2468-
Make a pie chart of array *x*. The fractional area of each
2469-
wedge is given by ``x/sum(x)``. If ``sum(x) <= 1``, then the
2470-
values of x give the fractional area directly and the array
2471-
will not be normalized. The wedges are plotted
2472-
counterclockwise, by default starting from the x-axis.
2468+
Make a pie chart of array *x*. The fractional area of each wedge is
2469+
given by ``x/sum(x)``. If ``sum(x) < 1``, then the values of *x* give
2470+
the fractional area directly and the array will not be normalized. The
2471+
resulting pie will have an empty wedge of size ``1 - sum(x)``.
2472+
2473+
The wedges are plotted counterclockwise, by default starting from the
2474+
x-axis.
24732475
24742476
Parameters
24752477
----------
24762478
x : array-like
2477-
The input array used to make the pie chart.
2479+
The wedge sizes.
24782480
24792481
explode : array-like, optional, default: None
2480-
If not *None*, is a ``len(x)`` array which specifies the
2481-
fraction of the radius with which to offset each wedge.
2482+
If not *None*, is a ``len(x)`` array which specifies the fraction
2483+
of the radius with which to offset each wedge.
24822484
24832485
labels : list, optional, default: None
24842486
A sequence of strings providing the labels for each wedge
24852487
24862488
colors : array-like, optional, default: None
24872489
A sequence of matplotlib color args through which the pie chart
2488-
will cycle. If `None`, will use the colors in the currently
2490+
will cycle. If *None*, will use the colors in the currently
24892491
active cycle.
24902492
24912493
autopct : None (default), string, or function, optional
@@ -2495,9 +2497,8 @@ def pie(self, x, explode=None, labels=None, colors=None,
24952497
If it is a function, it will be called.
24962498
24972499
pctdistance : float, optional, default: 0.6
2498-
The ratio between the center of each pie slice and the
2499-
start of the text generated by *autopct*. Ignored if
2500-
*autopct* is *None*.
2500+
The ratio between the center of each pie slice and the start of
2501+
the text generated by *autopct*. Ignored if *autopct* is *None*.
25012502
25022503
shadow : bool, optional, default: False
25032504
Draw a shadow beneath the pie.
@@ -2517,7 +2518,7 @@ def pie(self, x, explode=None, labels=None, colors=None,
25172518
25182519
wedgeprops : dict, optional, default: None
25192520
Dict of arguments passed to the wedge objects making the pie.
2520-
For example, you can pass in``wedgeprops = {'linewidth': 3}``
2521+
For example, you can pass in ``wedgeprops = {'linewidth': 3}``
25212522
to set the width of the wedge border lines equal to 3.
25222523
For more details, look at the doc/arguments of the wedge object.
25232524
By default ``clip_on=False``.
@@ -2526,8 +2527,8 @@ def pie(self, x, explode=None, labels=None, colors=None,
25262527
Dict of arguments to pass to the text objects.
25272528
25282529
center : list of float, optional, default: (0, 0)
2529-
Center position of the chart. Takes value (0, 0) or is a
2530-
sequence of 2 scalars.
2530+
Center position of the chart. Takes value (0, 0) or is a sequence
2531+
of 2 scalars.
25312532
25322533
frame : bool, optional, default: False
25332534
Plot axes frame with the chart if true.
@@ -2541,11 +2542,11 @@ def pie(self, x, explode=None, labels=None, colors=None,
25412542
A sequence of :class:`matplotlib.patches.Wedge` instances
25422543
25432544
texts : list
2544-
A is a list of the label :class:`matplotlib.text.Text` instances.
2545+
A list of the label :class:`matplotlib.text.Text` instances.
25452546
25462547
autotexts : list
2547-
A is a list of :class:`~matplotlib.text.Text` instances for the
2548-
numeric labels. Is returned only if parameter *autopct* is
2548+
A list of :class:`~matplotlib.text.Text` instances for the numeric
2549+
labels. This will only be returned if the parameter *autopct* is
25492550
not *None*.
25502551
25512552
Notes
@@ -4648,34 +4649,35 @@ def fill(self, *args, **kwargs):
46484649
46494650
Parameters
46504651
----------
4651-
args : a variable length argument
4652-
It allowing for multiple
4653-
*x*, *y* pairs with an optional color format string; see
4654-
:func:`~matplotlib.pyplot.plot` for details on the argument
4655-
parsing. For example, each of the following is legal::
4652+
args : sequence of x, y, [color]
4653+
Each polygon is defined by the lists of *x* and *y* positions of
4654+
its nodes, optionally followed by by a *color* specifier. See
4655+
:mod:`matplotlib.colors` for supported color specifiers. The
4656+
standard color cycle is used for polygons without a color
4657+
specifier.
46564658
4657-
ax.fill(x, y)
4658-
ax.fill(x, y, "b")
4659-
ax.fill(x, y, "b", x, y, "r")
4659+
You can plot multiple polygons by providing multiple *x*, *y*,
4660+
*[color]* groups.
46604661
4661-
An arbitrary number of *x*, *y*, *color* groups can be specified::
4662-
ax.fill(x1, y1, 'g', x2, y2, 'r')
4662+
For example, each of the following is legal::
4663+
4664+
ax.fill(x, y) # a polygon with default color
4665+
ax.fill(x, y, "b") # a blue polygon
4666+
ax.fill(x, y, x2, y2) # two polygons
4667+
ax.fill(x, y, "b", x2, y2, "r") # a blue and a red polygon
46634668
46644669
Returns
46654670
-------
4666-
a list of :class:`~matplotlib.patches.Patch`
4671+
a list of :class:`~matplotlib.patches.Polygon`
46674672
46684673
Other Parameters
46694674
----------------
46704675
**kwargs : :class:`~matplotlib.patches.Polygon` properties
46714676
46724677
Notes
46734678
-----
4674-
The same color strings that :func:`~matplotlib.pyplot.plot`
4675-
supports are supported by the fill format string.
4676-
4677-
If you would like to fill below a curve, e.g., shade a region
4678-
between 0 and *y* along *x*, use :meth:`fill_between`
4679+
Use :meth:`fill_between` if you would like to fill the region between
4680+
two curves.
46794681
46804682
46814683
"""

0 commit comments

Comments
 (0)