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
Use the xlabel() method in matplotlib to add a label to the plot's x-axis. In the above example, we import matplotlib. pyplot package and define the data coordinates for plotting. After that, the plot() method is used to draw a line between y and x.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With