Radar Chart

Tennis Grand Slam Player Comparison

Radar chart comparing professional tennis players across key performance metrics including serve speed, accuracy, endurance, and mental strength.

Output
Tennis Grand Slam Player Comparison
Python
import matplotlib.pyplot as plt
import numpy as np

# Tennis player performance data
categories = ['Serve Power', 'Return Game', 'Net Play', 'Baseline Rally',
              'Mental Strength', 'Endurance', 'Movement Speed', 'Shot Accuracy']
              
player1 = [95, 78, 85, 88, 92, 85, 80, 86]  # Power player
player2 = [82, 92, 75, 95, 88, 92, 88, 90]  # Baseline specialist
player3 = [88, 85, 92, 82, 85, 80, 85, 84]  # All-court player

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

player1 += player1[:1]
player2 += player2[:1]
player3 += player3[:1]

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

# Plot each player
ax.plot(angles, player1, 'o-', linewidth=2.5, color='#F5276C', label='Djokovic-style', markersize=7)
ax.fill(angles, player1, alpha=0.15, color='#F5276C')

ax.plot(angles, player2, 's-', linewidth=2.5, color='#27D3F5', label='Nadal-style', markersize=7)
ax.fill(angles, player2, alpha=0.15, color='#27D3F5')

ax.plot(angles, player3, '^-', linewidth=2.5, color='#6CF527', label='Federer-style', markersize=7)
ax.fill(angles, player3, alpha=0.15, color='#6CF527')

ax.set_xticks(angles[:-1])
ax.set_xticklabels(categories, fontsize=11, color='#374151', fontweight='500')
ax.set_ylim(0, 100)

ax.yaxis.grid(True, color='#e5e7eb', linestyle='-', linewidth=0.8)
ax.xaxis.grid(True, color='#d1d5db', linestyle='-', linewidth=0.5)
ax.spines['polar'].set_color('#d1d5db')

ax.set_title('Tennis Grand Slam Player Profiles', fontsize=16, color='#1f2937',
             fontweight='bold', pad=25)

ax.legend(loc='upper right', bbox_to_anchor=(1.15, 1.1), fontsize=10,
          frameon=True, facecolor='white', edgecolor='#e5e7eb')

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Polar Charts

Did this help you?

Support PyLucid to keep it free & growing

Support