Custom percentage scale used by windrose.py
Asked Answered
L

0

1

I am creating windrose plots using the windrose.py module. I have correctly changed the bin sizes but want to change the yaxis (percentage) tick positions/ labels to: 0, 5, 10, 15, 20 using this code:

from windrose import WindroseAxes

fig = plt.figure()
rect=[0.1,0.1,0.8,0.8]   
wAxes = WindroseAxes(fig,rect)
fig.add_axes(wAxes)  

bins_Range = np.arange(0, 25, 2.5)                    
wAxes.bar(WindDir, WindSpd, normed=True,edgecolor='black',bins = bins_Range)

wAxes.set_ylim(0,20)
wAxes.yaxis.set_ticks(np.arange(0,20,5))

wAxes.legend(loc='lower left')
fig.savefig('WindRose.png')  

This creates the plot but does not affect the percentage axis, it still produces plots with a y-axis scale dependent on the data. Any help much appreciated!

Lemming answered 10/1, 2018 at 17:14 Comment(2)
I did quite a bit of work with this library. If I remember right, you'll have to dig into the windrose.py file itself to change this behavior, I don't think it's accessible from the outside, though you could modify it to add such functionality if you wishGhetto
I have the same question, but cannot figure out how to access it in windrose.py . I think it might have something to do with the 'frequency' argument in the line in windrose.py about def _init_plot(self, direction, var, **kwargs)" ... but I cannot figure out how to implement this in the code example in the questionAplite

© 2022 - 2024 — McMap. All rights reserved.