windrose
windrose copied to clipboard
i want fix the legend range in rose plot
the above plots different legend
i want fix the range of the lengend
my code is here
from windrose import WindroseAxes from matplotlib import pyplot as plt import matplotlib.cm as cm from numpy.random import random from numpy import arange import pandas as pd MON=pd.read_csv(r'data.csv') ws = MON["Ws"].values wd = MON["Wd"].values ax = WindroseAxes.from_ax() ax.set_ylim(0,50) ax.bar(wd, ws, normed=True, opening=0.8, edgecolor='white') ax.set_title('plot2') ax.set_legend()
I am not sure I understand what your issue or request actually is:
but you can use bins
to make the plot/legend have "nicer" groups
ax.bar(wd, ws, normed=True, opening=0.8, edgecolor='white', bins=(0, 1, 2, 3, 4, 5)