Horizon Chart
Municipal Water Usage Horizon
Utility monitoring horizon chart showing water consumption with deep blue neon gradient.
Output
Python
import matplotlib.pyplot as plt
import numpy as np
COLORS = {
'bands': ['#0d1a4d', '#1a3399', '#276CF5', '#60A5FA'],
'background': '#0a0a0f',
'text': '#ffffff',
}
np.random.seed(2828)
hours = np.arange(0, 168) # Week
# Water usage: morning/evening peaks, lower at night
morning = 50 * np.exp(-((hours % 24 - 7)**2) / 4)
evening = 40 * np.exp(-((hours % 24 - 19)**2) / 5)
weekend_lawn = np.where((hours % 168 > 120), 30 * np.exp(-((hours % 24 - 10)**2) / 8), 0)
usage = morning + evening + weekend_lawn + np.random.exponential(5, len(hours))
usage = np.clip(usage, 0, 100)
usage_norm = usage / 100
fig, ax = plt.subplots(figsize=(14, 3), facecolor=COLORS['background'])
ax.set_facecolor(COLORS['background'])
band = 0.25
ax.fill_between(hours, 0, np.clip(usage_norm, 0, band), color=COLORS['bands'][0])
ax.fill_between(hours, 0, np.clip(usage_norm - band, 0, band), color=COLORS['bands'][1])
ax.fill_between(hours, 0, np.clip(usage_norm - 2*band, 0, band), color=COLORS['bands'][2])
ax.fill_between(hours, 0, np.clip(usage_norm - 3*band, 0, band), color=COLORS['bands'][3])
ax.set_xlim(0, 167)
ax.set_ylim(0, 0.3)
ax.set_title('Municipal Water Usage (million gallons/hour)', color=COLORS['text'], fontsize=12, fontweight='bold', pad=10)
ax.set_xlabel('Day', color=COLORS['text'], fontsize=10)
ax.set_ylabel('Usage (Mgal)', color=COLORS['text'], fontsize=10)
ax.set_xticks([0, 24, 48, 72, 96, 120, 144])
ax.set_xticklabels(['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'])
for spine in ax.spines.values():
spine.set_visible(False)
ax.tick_params(colors=COLORS['text'], labelsize=9)
plt.tight_layout()
plt.show()
Library
Matplotlib
Category
Time Series
More Horizon Chart examples
☕