Area Chart
Dual Axis Area
Revenue and users on separate Y-axes.
Output
Python
import matplotlib.pyplot as plt
import numpy as np
# Data
months = np.arange(1, 13)
revenue = [120, 135, 155, 180, 210, 245, 280, 265, 230, 195, 160, 140]
users = [1.2, 1.4, 1.7, 2.1, 2.6, 3.2, 3.8, 3.5, 3.0, 2.5, 2.0, 1.6]
# Figure - DARK THEME
fig, ax1 = plt.subplots(figsize=(10, 6), facecolor='#0a0a0f')
ax1.set_facecolor('#0a0a0f')
# Revenue (left axis)
ax1.fill_between(months, 0, revenue, alpha=0.3, color='#27D3F5')
ax1.plot(months, revenue, color='#27D3F5', linewidth=2.5, label='Revenue')
ax1.set_xlabel('Month', color='white', fontsize=11)
ax1.set_ylabel('Revenue ($K)', color='#27D3F5', fontsize=11)
ax1.tick_params(axis='y', colors='#27D3F5', labelsize=9)
ax1.tick_params(axis='x', colors='#888888', labelsize=9)
# Users (right axis)
ax2 = ax1.twinx()
ax2.fill_between(months, 0, users, alpha=0.3, color='#F5276C')
ax2.plot(months, users, color='#F5276C', linewidth=2.5, label='Users')
ax2.set_ylabel('Active Users (M)', color='#F5276C', fontsize=11)
ax2.tick_params(axis='y', colors='#F5276C', labelsize=9)
# Title and spines
ax1.set_title('Revenue vs User Growth', color='white', fontsize=14, fontweight='bold', pad=15)
for spine in ax1.spines.values():
spine.set_color('#333333')
for spine in ax2.spines.values():
spine.set_color('#333333')
ax1.set_xlim(1, 12)
ax1.set_xticks(months)
# Combined legend
lines1, labels1 = ax1.get_legend_handles_labels()
lines2, labels2 = ax2.get_legend_handles_labels()
ax1.legend(lines1 + lines2, labels1 + labels2, loc='upper left', facecolor='#0a0a0f', edgecolor='#333333', labelcolor='white')
plt.tight_layout()
plt.show()
Library
Matplotlib
Category
Basic Charts
More Area Chart examples
☕