Using pyplot circle
function I made a circle, then I have used text
function to place the text(parameters) across the circle(PLOT ATTACHED) but the thing is if let's say I want to list out only 6 or say 11 parameters equally spaced across the circle I'll have to chage the coordinates as well as the rotation in text
(and the coordinates and rotation value has been manually set). I want something that'll automate these things like given a number of parameter it will place parameter with equal spacing between them around the circle
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
fig, ax = plt.subplots(figsize=(30, 20))
ax.axis('equal')
ax.set(xlim=(-10, 23), ylim = (-10, 10))
circle = plt.Circle((0, 0), 4.7, fc='#cfe2f3')
ax.add_patch(circle)
ax.text(-0.4, 4.9, 'npxG', fontsize=15)
ax.text(3.35, 3.5, 'xA', rotation=310, fontsize=15)
ax.text(4.8, -0.5, 'Shots on Target', rotation=270, fontsize=15)
ax.text(3.35, -3.55, 'Dribbles', rotation=50, fontsize=15)
ax.text(-1, -5., 'Through Balls', fontsize=15)
ax.text(-4.6, -3.6, 'Passes 1/3', rotation=305, fontsize=15)
ax.text(-5, -0.5, 'Key Passes', rotation=90, fontsize=15)
ax.text(-4., 3.3, 'Crosses', rotation=42, fontsize=15)
ax.axis('off')
Edit:
for i in range(0, len(data)):
a = points[i,2]
x,y = (radius*np.sin(a), radius*np.cos(a))
a = a - 0.5*np.pi
if points[i,1] < 0:
a = a - np.pi
ax.text(x, y, data[i], rotation = np.rad2deg(a), ha="center", va="center", fontsize=15)