Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/4-pie-chart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@
"source": [
"# TASK: Create a pie chart with the following data: labels = ['Python', 'Java', 'C++', 'JavaScript'] and sizes = [40, 25, 20, 15].\n",
"# Display the percentages on the chart using autopct."
import matplotlib.pyplot as plt

# Data
labels = ['Python', 'Java', 'C++', 'JavaScript']
sizes = [40, 25, 20, 15]

# Plotting
plt.pie(sizes, labels=labels, autopct='%1.1f%%', startangle=90)
plt.title("Programming Language Popularity")
plt.axis('equal') # Equal aspect ratio ensures the pie chart is circular.
plt.show()

]
}
],
Expand Down