Can you please create a pie chart of Canada's population by province
- User
Can you please create a pie chart of Canada's population by province
Assistant
Here is a pie chart of Canada's population by province based on 2021 data:
pythonimport matplotlib.pyplot as plt labels = ['Ontario', 'Quebec', 'British Columbia', 'Alberta', 'Manitoba', 'Saskatchewan', 'Nova Scotia', 'New Brunswick', 'Newfoundland and Labrador', 'Prince Edward Island', 'Nunavut', 'Northwest Territories', 'Yukon'] sizes = [14.57, 8.38, 5.03, 4.37, 1.36, 1.17, 971,778, 782,503, 526,702, 158,844, 42,562, 44,232, 42,004] fig1, ax1 = plt.subplots() ax1.pie(sizes, labels=labels, autopct='%1.1f%%', shadow=True, startangle=90) ax1.axis('equal') plt.title('Canada Population by Province (2021)') plt.show()
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.