# 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.

```python
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.

```python
from oowl.plotting import use_style

use_style()
```

```{eval-rst}
.. currentmodule:: oowl.plotting

.. autodata:: STYLE_RCPARAMS

.. autofunction:: use_style
```
