-
Notifications
You must be signed in to change notification settings - Fork 132
Open
Description
Requesting a minor addition to include a %-sign on the y-axis values when the normed=True flag is used.
I believe this should be a simple fix and have provided a simple example below which relies on matplotlib.ticker.PercentFormatter.
Likely would just need to pass the normed=True kwarg to the WindAxesFactory create method. I would be willing to open a PR for this.
Minimal Working Example
import numpy as np
from matplotlib.ticker import PercentFormatter
from windrose import plot_windrose
df = pd.DataFrame(data={
'speed':np.random.random(1000),
'direction':np.random.randint(low=0,high=361,size=1000),
})
ax = plot_windrose(df,kind='bar',normed=True)
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! #
# Adding this line formats the y-axis as x% #
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! #
ax.yaxis.set_major_formatter(PercentFormatter())Metadata
Metadata
Assignees
Labels
No labels
