When creating radar charts using matplotlib, is there a way to remove the circle 'labels' on the radar chart?

Viewed 538

I was creating a radar chart using the code below:

stats = dataset[1]
labels = dataset[0]

angles=np.linspace(0, 2*np.pi, len(labels), endpoint=False)
# close the plot
stats=np.concatenate((stats,[stats[0]]))
angles=np.concatenate((angles,[angles[0]]))

fig=plt.figure()
ax = fig.add_subplot(111, polar=True)
ax.scatter(angles, stats)
ax.set_thetagrids(angles * 180/np.pi, labels)
ax.grid(True)

Here, stats is the data and labels are the labels. This gives a plot like this:

Matplotlib Radar Chart

Is there a way to get rid of the annoying '25,50,75,...,175' on each of the circles given in the plot?

Thanks.

1 Answers

You can hide the radial tick labels (y-tick labels) using the following after plotting the data

ax.set_yticklabels([])
Related