Heatmap

Cloud Resource Utilization

Seamless heatmap of cloud service resource usage across regions

Output
Cloud Resource Utilization
Python
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import LinearSegmentedColormap

fig, ax = plt.subplots(figsize=(12, 8), facecolor='#ffffff')
ax.set_facecolor('#ffffff')

np.random.seed(42)
services = ['EC2', 'Lambda', 'S3', 'RDS', 'DynamoDB', 'ElastiCache', 'EKS']
regions = ['us-east-1', 'us-west-2', 'eu-west-1', 'ap-southeast-1', 'ap-northeast-1']
data = np.random.randint(10, 95, (len(services), len(regions)))

# Modern gradient: Purple to Blue (AWS-inspired)
colors = ['#ede9fe', '#a78bfa', '#7c3aed', '#4f46e5', '#1e1b4b']
cmap = LinearSegmentedColormap.from_list('modern', colors, N=256)

im = ax.imshow(data, cmap=cmap, aspect='auto', vmin=0, vmax=100)

ax.set_xticks(range(len(regions)))
ax.set_yticks(range(len(services)))
ax.set_xticklabels(regions, rotation=45, ha='right', color='#374151', fontsize=9)
ax.set_yticklabels(services, color='#1f2937', fontsize=10, fontweight='500', family='monospace')

for i in range(len(services)):
    for j in range(len(regions)):
        val = data[i, j]
        color = '#ffffff' if val > 50 else '#1f2937'
        ax.text(j, i, f'{val}%', ha='center', va='center', color=color, fontsize=10, fontweight='bold')

cbar = plt.colorbar(im, ax=ax, shrink=0.8, pad=0.02)
cbar.set_label('Utilization (%)', color='#1f2937', fontsize=11)
cbar.outline.set_edgecolor('#e5e7eb')
plt.setp(plt.getp(cbar.ax.axes, 'yticklabels'), color='#6b7280')

for spine in ax.spines.values():
    spine.set_color('#e5e7eb')
ax.set_title('AWS Resource Utilization by Region', fontsize=16, color='#111827', fontweight='bold', pad=15)
plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Heatmaps & Density

Did this help you?

Support PyLucid to keep it free & growing

Support