Plotting

Plotting#

Boundaries, farms, clusters, string guides, surfaces, wind resources and site conditions all have a plot() method. Without ax=, a call creates a suitably sized figure, and single-panel plots return their axes for further Matplotlib calls.

import matplotlib.pyplot as plt

import oowl
from oowl import boundaries as B
from oowl import layouts as L

boundary = B.Rectangle(9, 5, area=45_000_000)
farm = oowl.Sampler(boundary, L.Grid(n_turbines=92, seed=4)).sample()[0]

fig, axes = plt.subplots(1, 2)
farm.plot(ax=axes[0], title="Farm")
boundary.plot(ax=axes[1], title="Boundary")

SiteConditions.plot() draws four panels, the wind rose, turbulence, stability and the wind-speed histogram, and returns the array of their four axes. Pass ax= a sequence of four axes, the first polar, to draw on an existing figure. A wind resource plots its wind-speed rose, or its turbulence rose with variable="turbulence_intensity".

Plots follow the active Matplotlib style. A farm takes the first color of the property cycle, a cluster’s farms take successive cycle colors, and color= overrides either. Roses and surfaces use the image.cmap colormap unless cmap= is given. Exclusion zones are hatched holes in the axes background, a cluster scattered across a domain outlines it, and regions=False draws boundaries and turbines only.

The plot() methods never change global Matplotlib settings. To give plain Matplotlib figures the sizes used in this documentation, call use_style(), which does.

from oowl.plotting import use_style

use_style()
oowl.plotting.STYLE_RCPARAMS: Mapping[str, Any] = mappingproxy({'figure.dpi': 110.0, 'savefig.dpi': 110.0, 'axes.grid': True, 'grid.alpha': 0.3, 'font.size': 10.0, 'axes.titlesize': 12.0, 'axes.labelsize': 10.0, 'legend.fontsize': 9.0, 'xtick.labelsize': 9.0, 'ytick.labelsize': 9.0})#

Matplotlib readability defaults applied by use_style().

oowl.plotting.use_style()[source]#

Apply OOWL’s documentation defaults to global Matplotlib settings.

Updates matplotlib.rcParams with STYLE_RCPARAMS, so repeated calls are idempotent. OOWL’s own plots do not need it. It does not import matplotlib.pyplot, select a backend or enable interactive mode.

Return type:

None