Area Chart
Temperature Range
Monthly temperature with normal and record ranges.
Output
Python
import matplotlib.pyplot as plt
import numpy as np
# Data - Monthly temperature ranges
months = np.arange(1, 13)
avg_high = [8, 10, 14, 18, 23, 27, 30, 29, 25, 19, 13, 9]
avg_low = [1, 2, 5, 8, 12, 16, 19, 19, 15, 10, 5, 2]
record_high = [15, 18, 22, 26, 31, 35, 38, 37, 33, 27, 20, 16]
record_low = [-8, -6, -2, 1, 5, 10, 13, 12, 8, 2, -3, -6]
# Figure - LIGHT THEME
fig, ax = plt.subplots(figsize=(10, 6), facecolor='#ffffff')
ax.set_facecolor('#ffffff')
# Temperature bands
ax.fill_between(months, record_low, record_high, alpha=0.15, color='#F5276C', label='Record range')
ax.fill_between(months, avg_low, avg_high, alpha=0.4, color='#F5B027', label='Average range')
ax.plot(months, avg_high, color='#F54927', linewidth=2, label='Avg high')
ax.plot(months, avg_low, color='#27D3F5', linewidth=2, label='Avg low')
# Styling
ax.set_xlabel('Month', color='#1f2937', fontsize=11)
ax.set_ylabel('Temperature (°C)', color='#1f2937', fontsize=11)
ax.set_title('Annual Temperature Range', color='#1f2937', fontsize=14, fontweight='bold', pad=15)
ax.tick_params(colors='#374151', labelsize=9)
ax.set_xticks(months)
ax.set_xticklabels(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], rotation=45)
for spine in ax.spines.values():
spine.set_color('#e5e7eb')
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.yaxis.grid(True, color='#f3f4f6', linewidth=0.5)
ax.legend(facecolor='#ffffff', edgecolor='#e5e7eb', labelcolor='#1f2937', loc='upper right')
ax.axhline(0, color='#374151', linewidth=0.5, linestyle='-')
plt.tight_layout()
plt.show()
Library
Matplotlib
Category
Basic Charts
More Area Chart examples
☕