Windrose
raw JSON → 1.10.0 verified Sat May 09 auth: no python
Windrose is a Python library using Matplotlib and Numpy to manage wind data and draw windrose (polar rose) plots. It provides tools for wind direction and speed frequency visualization, with a simple interface for binned speed roses. Current version 1.10.0 requires Python >=3.10. Release cadence is intermittent, with occasional patches.
pip install windrose Common errors
error AttributeError: module 'windrose' has no attribute 'WindroseAxes' ↓
cause Importing from the wrong submodule after version 1.6. The package no longer exposes classes through the deprecated submodule path.
fix
Use 'from windrose import WindroseAxes' (not 'from windrose.windrose import WindroseAxes')
error AttributeError: module 'windrose' has no attribute 'wr_plot' ↓
cause Function was renamed in windrose 1.6. 'wr_plot' no longer exists.
fix
Use 'from windrose import plot_windrose' instead.
error TypeError: bar() missing 1 required positional argument: 'direction' ↓
cause Passing wind direction and speed as positional arguments in wrong order or omitting direction.
fix
Ensure you call ax.bar(direction, speed, ...) with direction (degrees) first, then speed.
Warnings
deprecated Importing from submodule 'windrose.windrose' is deprecated; directly import from 'windrose'. ↓
fix Use 'from windrose import WindroseAxes' instead of 'from windrose.windrose import WindroseAxes'.
breaking In version 1.6, the function 'wr_plot' was renamed to 'plot_windrose' and the old name removed. ↓
fix Replace 'wr_plot' calls with 'plot_windrose'.
gotcha WindroseAxes.bar() modifies the axes limits internally; calling plt.tight_layout() may distort the plot. ↓
fix Avoid automatic layout adjustment or apply after plotting with constrained layout.
Imports
- WindroseAxes wrong
from windrose.windrose import WindroseAxescorrectfrom windrose import WindroseAxes - plot_windrose wrong
from windrose import wr_plotcorrectfrom windrose import plot_windrose - Windrose
from windrose import Windrose
Quickstart
import numpy as np
import matplotlib.pyplot as plt
from windrose import WindroseAxes
# Generate synthetic wind data
ws = np.random.weibull(2, 100) * 10 # wind speed
wd = np.random.uniform(0, 360, 100) # wind direction
# Create windrose plot
ax = WindroseAxes.from_ax()
ax.bar(wd, ws, normed=True, opening=0.8, edgecolor='white')
ax.set_legend()
plt.show()