In the following snippet a tuple is provided to the explode parameter of the pie() function. The above example made only one of the wedges of a pie chart to explode out. Making multiple wedges of a pie chart to explode: Only the first element of the tuple is mentioned a fraction while all other elements are zero, which will make only the first wedge of the pie chart to look apart from the rest of the chart. In the above snippet the pie() function is passed with a tuple for the explode argument. Otherwise matplotlib will raise an exception of type ValueError. The length of the tuple should be equal to the number of pies in the pie chart. Making a wedge in a pie chart to explode:Ī wedge of a pie chart can be made to explode from the rest of the wedges of the pie chart using the explode parameter of the pie function.Įxplode is a tuple where each element corresponds to a wedge of the pie chart. # Aspect ratio - equal means pie is a circle PopulationShare = įigureObject, axesObject = plotter.subplots() PieLabels = 'Asia', 'Africa', 'Europe', 'North America', 'South America', 'Australia' # The slice names of a population distribution pie chart The below python code example draws a pie chart using the pie() function.īy default the pie() fucntion of pyplot arranges the pies or wedges in a pie chart in counter clockwise direction. Pie charts can be drawn using the function pie() in the pyplot module. Pie charts are also used heavily in survey results, news articles, resource usage diagrams like disk and memory.ĭrawing a simple Pie Chart using Python Matplotlib.Pie charts are frequently used in business presentations as they give quick summary of the business activities like sales, operations and so on.The area of the wedges determines the relative quantum or percentage of a part with respect to a whole.The length of the arc of a wedge determines the area of a wedge in a pie chart.The parts of a pie chart are called wedges.The areas of the pies present in the Pie chart represent the percentage of parts of data.The area of the whole chart represents 100% or the whole of the data.A pie chart is a circular statistical diagram.
0 Comments
Leave a Reply. |