donut_sales with exact keys and values for donut flavors and their sales.colors to hold a list of colors for the chart slices.matplotlib.pyplot.pie to create a pie chart with a hole in the center to make it a donut chart.donut_sales with exact keys and values for donut flavors and their sales.colors to hold a list of colors for the chart slices.matplotlib.pyplot.pie to create a pie chart with a hole in the center to make it a donut chart.donut_sales with these exact entries: 'Glazed': 40, 'Chocolate': 35, 'Strawberry': 25.Use curly braces {} to create the dictionary with keys as donut flavors and values as sales numbers.
colors with these exact color strings: '#ff9999', '#66b3ff', '#99ff99'.Colors are strings inside a list. Use square brackets [] and separate colors with commas.
matplotlib.pyplot as plt. Use plt.pie with donut_sales.values() for sizes, labels=donut_sales.keys(), colors=colors, and wedgeprops={{'width': 0.4}} to create a donut chart.Use import matplotlib.pyplot as plt at the top. The wedgeprops with {'width': 0.4} creates the donut hole.
plt.title("Donut Sales Distribution") to set the chart title. Then call plt.show() to display the chart.Use plt.title() to add a title. plt.show() displays the chart window.
What is the main difference between a donut chart and a pie chart in matplotlib?
Which matplotlib code snippet correctly creates a donut chart with a hole size controlled by wedgeprops?
import matplotlib.pyplot as plt sizes = [30, 40, 30] plt.pie(sizes, wedgeprops=???) plt.show()
What will be the visual output of this code?
import matplotlib.pyplot as plt
sizes = [10, 20, 30]
plt.pie(sizes, wedgeprops={'width': 0.3})
plt.show()Identify the error in this donut chart code and select the fix:
import matplotlib.pyplot as plt
sizes = [25, 35, 40]
plt.pie(sizes, wedgeprops={'width': '0.5'})
plt.show()You want to create a donut chart showing sales distribution with a hole size that leaves 40% thickness for the slices. Which wedgeprops value should you use?
Pass the test and this pattern moves unknown