fig, axs = plt.subplots(2, 3, figsize=(14, 9))
np.random.seed(42)
# Time series → Line
dates = np.arange(30)
values = np.cumsum(np.random.randn(30)) + 50
axs[0, 0].plot(dates, values, 'o-', color='#264653', markersize=4)
axs[0, 0].set_title("Trend → Line Chart")
axs[0, 0].set_xlabel("Day")
axs[0, 0].fill_between(dates, values, alpha=0.2)
# Categories → Bar
cats = ['A', 'B', 'C', 'D']
vals = [25, 40, 30, 45]
axs[0, 1].bar(cats, vals, color=['#264653', '#2a9d8f', '#e9c46a', '#e76f51'])
axs[0, 1].set_title("Comparison → Bar Chart")
# Correlation → Scatter
x = np.random.randn(50)
y = 0.7*x + np.random.randn(50)*0.5
axs[0, 2].scatter(x, y, alpha=0.7, c='#2a9d8f', edgecolors='white')
axs[0, 2].set_title("Relationship → Scatter")
# Distribution → Histogram
data = np.random.randn(500)
axs[1, 0].hist(data, bins=25, color='#264653', edgecolor='white', alpha=0.8)
axs[1, 0].set_title("Distribution → Histogram")
# Spread → Box plot
data = [np.random.randn(100)*s + m for s, m in [(1, 0), (0.5, 2), (1.5, 1)]]
axs[1, 1].boxplot(data, labels=['Low var', 'High mean', 'High var'], patch_artist=True)
axs[1, 1].set_title("Spread → Box Plot")
# Proportion → Pie (use sparingly!)
sizes = [35, 25, 20, 20]
axs[1, 2].pie(sizes, labels=['A', 'B', 'C', 'D'], autopct='%1.0f%%',
colors=['#264653', '#2a9d8f', '#e9c46a', '#e76f51'])
axs[1, 2].set_title("Proportion → Pie (careful!)")
for ax in axs.flat:
if ax != axs[1, 2]:
ax.grid(alpha=0.3)
plt.tight_layout()
plt.show()