-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchart_builder.py
More file actions
34 lines (28 loc) · 1.18 KB
/
chart_builder.py
File metadata and controls
34 lines (28 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import matplotlib.pyplot as plt
from collections import Counter
# Data (including محمد زناتي)
data = {
"Eyad Ahmed Farouk": ["Customization (Rice)", "Command-Line Tools (CLI)", "AI", "DevOps"],
"Azad Mohamed": ["DevOps", "Filesystem"],
"Mariam Sayed": ["Cybersecurity"],
"omnia ibrahim": ["AI", "DevOps"],
"Samir Ahmed Morse Ahmed": ["Cybersecurity", "Customization (Rice)", "Command-Line Tools (CLI)", "AI"],
"Bishoy Ehab": ["Command-Line Tools (CLI)"],
"Amna": ["Command-Line Tools (CLI)", "AI", "DevOps"],
"Roqaya": ["Command-Line Tools (CLI)", "AI"],
"محمد زناتي": ["Customization (Rice)", "Command-Line Tools (CLI)", "AI"],
}
# Flatten all topics into a single list
all_topics = [topic for topics in data.values() for topic in topics]
# Count frequency of each topic
topic_counts = Counter(all_topics)
# Sort by frequency (most common first)
topics, counts = zip(*topic_counts.most_common())
# Plot the data
plt.figure(figsize=(8, 5))
# plt.barh(topics, counts, color='skyblue')
plt.pie(counts, labels=topics, autopct='%1.1f%%', startangle=140)
plt.title("Topic Distribution")
plt.gca().invert_yaxis()
plt.tight_layout()
plt.savefig("chart.png")