Question: PLEASE USE PYTHON! # piechart.py import matplotlib.pyplot as plt # The slices will be plotted counter-clockwise. labels = ['Apples', 'Pears', 'Bananas', 'Oranges'] sizes = [15,
PLEASE USE PYTHON!
# piechart.py
import matplotlib.pyplot as plt
# The slices will be plotted counter-clockwise.
labels = ['Apples', 'Pears', 'Bananas', 'Oranges']
sizes = [15, 30, 45, 10]
colors = ['lightgreen', 'gold', 'lightskyblue', 'lightcoral'] explode = (0, 0.1, 0, 0) # only "explode" the 2nd slice plt.figure(figsize=(5, 4))
plt.pie(sizes, explode=explode,
labels=labels,colors=colors,
autopct='%0.1f%%',
shadow=True, startangle=0)
# Set aspect ratio to be equal
# so that pie is drawn as a circle. plt.axis('equal') plt.show()
Modify piechart.py to add Strawberry into the list of fruits.
Change the amount of each in the chart to be: (Apple: 25, Pears:25, Bananas: 20, Orange: 15, and Strawberries: 15). Give Strawberries a red color in the chart. Show the chart.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
