Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed as not planned
Labels
Milestone
Description
Bug report
Adding twin x Axes into polar coordinate system seems does not work
Bug summary
Code for reproduction
importnumpyasnpfrommatplotlib.tickerimportFormatStrFormatterimportmatplotlib.pyplotaspltlabels=np.array(['E','','N','','W','','S',''])dataLength=8data=np.array([3.23,3.23,9.68,3.23,12.90,32.26,6.45,29.03])angles=np.linspace(0,2*np.pi,dataLength,endpoint=False)width=np.pi/8*np.array([1]*8)ax=plt.subplot(111,projection='polar')ax2=ax.twinx()bars=ax.bar(angles,data,alpha=0.4,label=labels,width=width,bottom=0.0,color="red")data=np.array([10.3,2.23,15.68,13.23,12.90,12.26,8.45,29.03])data=np.concatenate((data, [data[0]]))angles=np.concatenate((angles, [angles[0]]))plots=ax.plot(angles,data,alpha=0.7,linestyle="--",linewidth=1,color="blue")plt.fill(angles,data,facecolor='blue',alpha=0.25)gridLines,gridLabel=ax.set_thetagrids(angles*180/np.pi,labels,fontproperties="DejaVu Sans")ax.yaxis.set_major_formatter(FormatStrFormatter('%d%%'))plt.yticks(fontsize=8)plt.xticks(fontsize=15)[label.set_fontweight('bold')forlabelinax.get_xticklabels()][label.set_color('blue')forlabelinax.get_yticklabels()]plt.show()
Actual outcome
Expected outcome
Matplotlib version
- Operating system:
- Matplotlib version:
- Matplotlib backend (
print(matplotlib.get_backend())
): - Python version:
- Jupyter version (if applicable):
- Other libraries: