Code Bug Fix: Matplotlib polar plots: How to print both angles and labels?

Original Source Link

I am trying to plot a polar plot with using the following.
The problem is that when we put labels for different theta values, the value of theta is no more visible. For example at 90 degree if I want to put a label, say A, then only A is visible but not 90 degrees. I would like both of them to appear. How can I do that?

ax1 = fig.add_subplot(111, projection='polar')
c = ax1.scatter(df['P_radian'], abs(df['radius']), c=df['P_type'])
theta_range = range(0, 360, 45);
theta_label = (r'A_alpha', r'B_alpha', r'A_beta', r'B_beta', r'A_gamma', r'B_gamma', r'A_delta', r'B_delta')
lines, labels = ax1.set_thetagrids(theta_range, theta_label )

So in this case, when I want to print theta_labels, it doesn’t show the corresponding values of theta ticks. If I remove theta_label, it shows the tick values.
Is there anyway with which I get to print both the angle and the label without manually modifying theta_label values?

Tagged : / /

Leave a Reply

Your email address will not be published. Required fields are marked *