Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i want fix the legend range in rose plot #249

Open
satya0210 opened this issue Jun 29, 2023 · 1 comment
Open

i want fix the legend range in rose plot #249

satya0210 opened this issue Jun 29, 2023 · 1 comment

Comments

@satya0210
Copy link

plot1
plot2

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()

@jkittner
Copy link
Contributor

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants