Polar Chart

Microservice Health Radar

API endpoint availability with matrix aesthetic

Output
Microservice Health Radar
Python
import matplotlib.pyplot as plt
import numpy as np

endpoints = ['/auth', '/users', '/data', '/files', '/search', '/analytics', '/reports', '/export']
health = [99, 95, 98, 87, 92, 78, 94, 89]

health += health[:1]
angles = np.linspace(0, 2 * np.pi, len(endpoints), endpoint=False).tolist()
angles += angles[:1]

fig, ax = plt.subplots(figsize=(10, 10), subplot_kw=dict(polar=True), facecolor='#020B14')
ax.set_facecolor('#020B14')

for lw, alpha in [(12, 0.08), (8, 0.15), (4, 0.3)]:
    ax.plot(angles, health, color='#27F5B0', linewidth=lw, alpha=alpha)
ax.plot(angles, health, color='#27F5B0', linewidth=2)
ax.fill(angles, health, color='#27F5B0', alpha=0.2)

ax.set_xticks(angles[:-1])
ax.set_xticklabels(endpoints, fontsize=9, color='#27F5B0', fontweight='500', family='monospace')
ax.set_ylim(50, 100)
ax.set_yticks([60, 70, 80, 90, 100])
ax.set_yticklabels(['60%', '70%', '80%', '90%', '100%'], fontsize=8, color='#666666')
ax.spines['polar'].set_color('#555555')
ax.grid(color='#555555', linewidth=0.8, alpha=0.7)
ax.set_title('Microservice Health Radar', fontsize=16, color='#27F5B0', fontweight='bold', pad=20, y=1.08)

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Part-to-Whole

Did this help you?

Support PyLucid to keep it free & growing

Support