atmospy.pollutionroseplot#
- atmospy.pollutionroseplot(data=None, *, ws=None, wd=None, pollutant=None, faceted=False, segments=12, bins=[0, 10, 100, 1000, inf], suffix='a.u.', calm=0.0, lw=1, legend=True, palette='flare', title=None, **kwargs)#
Plot the intensity and directionality of a variable on a traditional wind-rose plot.
This function is a modified version of Phil Hobson’s work.
Traditionally, a wind rose plots wind speed and direction so that you can see from what direction is the wind coming from and at what velocity. For air quality purposes, we often wonder whether or not there is directionality to the intensity of a certain air pollutant. Well, look no further. This plot allows you to easily visualize the directionality of a pollutant.
- Parameters:
- data
pandas.DataFrame
Tabular data as a pandas DataFrame.
- wskey in
data
Variable that corresponds to the wind speed data in
data
.- wdkey in
data
Variable that corresponds to the wind direction data in
data
.- pollutantkey in
data
Variable that corresponds to the pollutant of interest in
data
.- facetedbool, optional
Set to
True
if plotting on a FacetGrid, by default False- segmentsint, optional
The number of bins along the theta axis to group by wind direction , by default 12
- binslist or array of floats, optional
An array of floats corresponding to the bin boundaries for
pollutant
; if the last entry is not inf, it will be automatically added, by default [0, 10, 100, 1000]- suffixstr, optional
The suffix (or units) to use on the labels for
pollutant
, by default “a.u.”- calmfloat, optional
Set the definition of calm conditions; data under calm winds will not be used to compute the statistics and will be shown on the plot as blank in the center, by default 0.
- lwint, optional
Set the line width, by default 1
- legendbool, optional
If
True
a legend will be added to the figure, by default True- palettestr, optional
Select the color palette to use, by default “flare”
- titlestr, optional
Set the figure title, by default None
- data
- Returns:
Examples
Using defaults, plot the pollution rose for PM2.5:
>>> df = atmospy.load_dataset("air-sensors-met") >>> atmospy.pollutionroseplot(data=df, ws="ws", wd="wd", pollutant="pm25")