Changing labels in matplotlib polar plot

这一生的挚爱 提交于 2019-12-19 19:43:58

问题


I am using matplotlib to create polar plots to represent Rose Diagrams. Right now the plot is getting created perfectly. I want to replace the angles being displayed on the axis with direction names: N for 0 degrees, W for 90 degrees, S for 180 degrees and E for 270 degrees.

The current rose diagram looks like the following:

Note: I have tried with windrose but this output is more appropriate for my purpose. Hence a good way of assigning custom labels to the axes will be very helpful.

The python version I am using is 2.6 with matplotlib version 1.2.0


回答1:


Assuming that you have an axes object ax you can do simply do something like this

ax.set_xticklabels(['N', '', 'W', '', 'S', '', 'E', ''])

or get some inspiration by this old example



来源:https://stackoverflow.com/questions/16085397/changing-labels-in-matplotlib-polar-plot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!