
Annotate a Polar Plot with a Coloured Wedge
annotate_polar_wedge.RdThis is a wrapper around ggplot2::annotate() which draws a semi-transparent
wedge on a plot with continuous polar coordinates (any of polar_plot(),
polar_annulus(), polar_freq() or rose_percentile()). Note
that, owing to the way ggplot2::geom_col() interacts with
ggplot2::coord_polar(), the .rose_angle argument should be used with
rose_pollution() and rose_wind().
Usage
annotate_polar_wedge(
start,
end,
fill = "red",
colour = NA,
alpha = 0.25,
...,
.rose_angle = NULL
)Arguments
- start
The angle at which to start the wedge. Can be expressed numerically, or using cardinal direction abbreviations ("N", "NNE", "NE", "ENE", etc.).
- end
The angle at which to end the wedge. See
endfor more details.- fill
The fill colour of the wedge. Defaults to "red".
- colour
The border colour of the wedge. Defaults to
NA, which means no border is drawn.- alpha
The transparency of the wedge.
1is totally opaque and0is completely transparent.- ...
Arguments to pass to
ggplot2::annotate().- .rose_angle
The number passed to the
angleargument ofrose_pollution()/rose_wind(). This is required to adjuststartandendwhen they are near to North/0 due to the wayggplot2::geom_col()interacts withggplot2::coord_polar().
Value
An annotation to be added to ggplot2::ggplot().
See also
Other polar annotation functions:
annotate_polar_axis(),
annotate_rose_text()
Examples
if (FALSE) {
polar_plot(mydata, "nox") + annotate_polar_wedge(start = "N", end = "E")
}