| [ Web Proxy ] |
| Viewing: https://matplotlib.org/gallery/mplot3d/../misc/../../api/_as_gen/matplotlib.pyplot.pie.html | [Back] [Original] |
Section Navigation
matplotlibmatplotlib.animationmatplotlib.artistmatplotlib.axesmatplotlib.axismatplotlib.backend_basesmatplotlib.backend_managersmatplotlib.backend_toolsmatplotlib.backendsmatplotlib.backends.backend_mixedmatplotlib.backends.backend_templatematplotlib.backends.backend_aggmatplotlib.backends.backend_cairomatplotlib.backends.backend_gtk3agg, matplotlib.backends.backend_gtk3cairomatplotlib.backends.backend_gtk4agg, matplotlib.backends.backend_gtk4cairomatplotlib.backends.backend_nbaggmatplotlib.backends.backend_pdfmatplotlib.backends.backend_pgfmatplotlib.backends.backend_psmatplotlib.backends.registrymatplotlib.backends.backend_qtagg, matplotlib.backends.backend_qtcairomatplotlib.backends.backend_svgmatplotlib.backends.backend_tkagg, matplotlib.backends.backend_tkcairomatplotlib.backends.backend_webagg_corematplotlib.backends.backend_webaggmatplotlib.backends.backend_wxagg, matplotlib.backends.backend_wxcairomatplotlib.beziermatplotlib.categorymatplotlib.cbookmatplotlib.cmmatplotlib.collectionsmatplotlib.colorbarmatplotlib.colorizermatplotlib.colorsmatplotlib.containermatplotlib.contourmatplotlib.datesmatplotlib.dvireadmatplotlib.figurematplotlib.font_managermatplotlib.ft2fontmatplotlib.gridspec
matplotlib.hatchmatplotlib.imagematplotlib.insetmatplotlib.layout_enginematplotlib.legendmatplotlib.legend_handlermatplotlib.lines
matplotlib.markers
matplotlib.mathtextmatplotlib.mlabmatplotlib.offsetboxmatplotlib.patchesmatplotlib.pathmatplotlib.patheffectsmatplotlib.pyplotmatplotlib.projections
matplotlib.quiver
matplotlib.rcsetupmatplotlib.sankeymatplotlib.scalematplotlib.sphinxext.mathmplmatplotlib.sphinxext.plot_directivematplotlib.sphinxext.figmpl_directivematplotlib.sphinxext.rolesmatplotlib.spinesmatplotlib.stylematplotlib.tablematplotlib.testingmatplotlib.textmatplotlib.texmanagermatplotlib.tickermatplotlib.transformsmatplotlib.trimatplotlib.typingmatplotlib.unitsmatplotlib.widgetsmatplotlib._afmmatplotlib._apimatplotlib._docstringmatplotlib._enumsmatplotlib._type1fontmatplotlib._tight_bboxmatplotlib._tight_layoutmpl_toolkits.mplot3dmpl_toolkits.axes_grid1mpl_toolkits.axisartistpylabmatplotlib.pyplotPlot a pie chart.
Make a pie chart of array x. The fractional area of each wedge is
given by x/sum(x).
The wedges are plotted counterclockwise, by default starting from the x-axis.
The wedge sizes.
If not None, is a len(x) array which specifies the fraction
of the radius with which to offset each wedge.
A sequence of strings providing the labels for each wedge
A sequence of colors through which the pie chart will cycle. If None, will use the colors in the currently active cycle.
Hatching pattern applied to all pie wedges or sequence of patterns through which the chart will cycle. For a list of valid patterns, see Hatch style reference.
Added in version 3.7.
If not None, autopct is a string or function used to label the
wedges with their numeric value. The label will be placed inside
the wedge. If autopct is a format string, the label will be
fmt % pct. If autopct is a function, then it will be called.
The relative distance along the radius at which the text
generated by autopct is drawn. To draw the text outside the pie,
set pctdistance > 1. This parameter is ignored if autopct is
None.
The relative distance along the radius at which the labels are
drawn. To draw the labels inside the pie, set labeldistance < 1.
If set to None, labels are not drawn but are still stored for
use in legend.
If bool, whether to draw a shadow beneath the pie. If dict, draw a shadow
passing the properties in the dict to Shadow.
Added in version 3.8: shadow can be a dict.
The angle by which the start of the pie is rotated, counterclockwise from the x-axis.
The radius of the pie.
Specify fractions direction, clockwise or counterclockwise.
Dict of arguments passed to each patches.Wedge of the pie.
For example, wedgeprops = {'linewidth': 3} sets the width of
the wedge border lines equal to 3. By default, clip_on=False.
When there is a conflict between these properties and other
keywords, properties passed to wedgeprops take precedence.
Dict of arguments to pass to the Text objects.
The coordinates of the center of the chart.
Plot Axes frame with the chart if true.
Rotate each label to the angle of the corresponding slice if true.
When True, always make a full pie by normalizing x so that
sum(x) == 1. False makes a partial pie if sum(x) <= 1
and raises a ValueError for sum(x) > 1.
If given, the following parameters also accept a string s, which is
interpreted as data[s] if s is a key in data:
x, explode, labels, colors
PieContainerContainer with all the wedge patches and any associated text objects.
Changed in version 3.11: Previously the wedges and texts were returned in a tuple.
Notes
Note
This is the pyplot wrapper for axes.Axes.pie.
The pie chart will probably look best if the figure and Axes are
square, or the Axes aspect is equal.
This method sets the aspect ratio of the axis to "equal".
The Axes aspect ratio can be controlled with Axes.set_aspect.
matplotlib.pyplot.pie#
Copyright 20022012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the Matplotlib development team; 20122026 The Matplotlib development team.
Created using Sphinx 9.1.0.
Built from v3.11.2-1-g879ad8ebba.
Built with the PyData Sphinx Theme 0.16.1.
| Web Proxy Viewer | New URL | Original Page |