1

I would like to create a radar chart for my data. However, I would like to add an error band to this chart.

There is a similar topic on StackOverflow. But, it is for R, and I would like to do it in python. (Error bars on a radar plot?)

Similar example: spider chart

Please, could anyone help me with this subject?

1 Answers1

1

My example is based on this one from matplotlib. You can get the other supporting functions there and I included how to use them on this example:

   N = 6
theta = radar_factory(N, frame='polygon')

axis = ['1', '2', '3', '4', '5', '6']
val =[0.88, 0.01, 0.03, 0.03, 0.00, 0.06]

fig, ax = plt.subplots(figsize=(9, 9),subplot_kw=dict(projection='radar'))

ax.set_rgrids([0.2, 0.4, 0.6, 0.8])

ax.plot(theta, val, color="b")

arr = np.array(val)
y_err = arr.std() * np.sqrt(1/len(arr) +(arr - arr.mean())**2 / np.sum((arr - arr.mean())**2))
y_est = arr

ax.fill(theta,  y_est + y_err, facecolor=color, alpha=0.25)
ax.fill(theta,  y_est - y_err, facecolor="white", alpha=1)

ax.set_varlabels(axis)

plt.show()

image example