import matplotlib.pyplot as plt
# Graph 1: Average Daily Time Spent on Social Media
platforms = ['TikTok', 'Instagram', 'Snapchat', 'YouTube', 'Other Platforms']
time_spent = [1.5, 1.2, 0.8, 1.0, 0.5]
# Plotting Bar Graph
plt.figure(figsize=(8, 5))
plt.bar(platforms, time_spent, color='teal')
plt.title('Average Daily Time Spent on Social Media by Generation Z')
plt.xlabel('Platform')
plt.ylabel('Average Time Spent (Hours/Day)')
plt.xticks(rotation=45)
plt.show()
# Graph 2: Social Media Usage Patterns (Active vs. Passive)
labels = ['Active Engagement', 'Passive Engagement']
sizes = [60, 40]
colors = ['#ff9999','#66b3ff']
# Plotting Pie Chart
plt.figure(figsize=(6, 6))
plt.pie(sizes, labels=labels, colors=colors, autopct='%1.1f%%', startangle=140)
plt.title('Social Media Usage Patterns (Active vs. Passive)')
plt.show()
# Graph 3: Advantages vs. Disadvantages of Social Media Use (Stacked Bar)
aspects = ['Mental Health', 'Social Interaction', 'Self-Expression', 'Learning/Advocacy', 'Productivity/Focus']
advantages = [30, 60, 80, 70, 40]
disadvantages = [70, 40, 20, 30, 60]
# Plotting Stacked Bar Graph
plt.figure(figsize=(8, 5))
plt.bar(aspects, advantages, color='lightgreen', label='Advantages')
plt.bar(aspects, disadvantages, bottom=advantages, color='salmon', label='Disadvantages')
plt.title('Advantages vs. Disadvantages of Social Media Use')
plt.xlabel('Aspect')
plt.ylabel('Percentage')
plt.legend()
plt.xticks(rotation=45)
plt.show()