.. _docs-meteoinfolab-funcitons-plot-pie: ******************* pie ******************* .. currentmodule:: mipylib.plotlib.miplot .. function:: pie(x, explode=None, labels=None, colors=None, autopct=None, pctdistance=0.6, shadow=False, labeldistance=1.1, startangle=0, radius=None, hold=None, **kwargs) Plot a pie chart. Make a pie chart of array *x*. The fraction area of each wedge is given by x/sum(x). If sum(x) <= 1, then the values of x give the fractional area directly and the array will not be normalized. The wedges are plotted counterclockwise, by default starting from the x-axis. :param explode: (*None | len(x)sequence) If not *None*, is a ``len(x)`` array which specifies the fraction of the radius with which to offset each wedge. :param labels: (*None | len(x) sequence of colors*] A sequence of strings providing the labels for each wedge. :param colors: (*None | color sequence*) A sequence of color args through which the pie chart will cycle. :param autopct: (*None | format string | format function) If not *None*, is a string or function used to label the wedges with their numeric value. The label will be placed inside the wedge. If it is a format string, the label will be ``fmt%pct``. If it is a function, it will be called. :param pctdistance: (*float*) The ratio between the center of each pie slice and the start of the text generated by *autopct*. Ignored if autopct is *None*; default is 0.6. :param labeldistance: (*float*) The ratial distance at which the pie labels are drawn. :param shadow: (*boolean*) Draw a shadow beneath the pie. :param startangle: (*float*) If not *0*, rotates the start of the pie chart by *angle* degrees counterclockwise from the x-axis. :radius: (*float*) The radius of the pie, if *radius* is *None* it will be set to 1. :param fontname: (*string*) Font name. Default is ``Arial`` . :param fontsize: (*int*) Font size. Default is ``14`` . :returns: (*tuple*) Patches and texts. Examples: :: x = [1, 3, 0.5, 2.5, 2] pie(x, explode=[0,1,0,1,0], startangle=90, autopct='%.1f%%') title('Pie chart') .. image:: ../../../../_static/pie_1.png