Pie Chart
Music Genre Preferences
Dark theme pie showing music listening habits by genre
Output
Python
import matplotlib.pyplot as plt
import numpy as np
fig, ax = plt.subplots(figsize=(10, 6), facecolor='#0a0a0f')
ax.set_facecolor('#0a0a0f')
genres = ['Pop', 'Hip-Hop', 'Rock', 'Electronic', 'R&B', 'Latin', 'Classical']
listeners = [25, 22, 15, 14, 10, 9, 5]
colors = ['#ec4899', '#f472b6', '#f9a8d4', '#fbcfe8', '#fce7f3', '#fdf2f8', '#faf5ff']
wedges, texts, autotexts = ax.pie(listeners, labels=genres, autopct='%1.0f%%',
colors=colors, startangle=90,
wedgeprops={'edgecolor': '#0a0a0f', 'linewidth': 2})
for text in texts:
text.set_color('white')
text.set_fontsize(10)
for autotext in autotexts:
autotext.set_color('#0a0a0f')
autotext.set_fontweight('bold')
ax.set_title('Music Genre Preferences', fontsize=16, fontweight='bold', color='white', pad=20)
plt.tight_layout()
Library
Matplotlib
Category
Basic Charts
More Pie Chart examples
☕