
Overlay a fitted von Mises density curve on a radiate plot
Source:R/circular_plotting.R
add_vonmises_density.RdEvaluates the von Mises probability density on a fine angular grid and
draws it as a closed polygon in the same Cartesian coordinate space used
by radiate and add_angle_rose. The curve
peaks at scale so the two layers align when given matching
scale values.
Usage
add_vonmises_density(
fit,
scale = 0.4,
inner_r = 0,
group_col = NULL,
n_pts = 360L,
colour = "steelblue",
linewidth = 0.8,
fill = NA,
alpha = 0.8,
display = NULL,
axial = FALSE,
color = NULL
)Arguments
- fit
Data frame from
vonmises_fit, containing at leastmuandkappacolumns.- scale
Maximum outer radius as a fraction of the unit circle. Default
0.4matchesadd_angle_rose.- inner_r
Inner radius; default
0.- group_col
Column in
fitfor faceting; must match thefacetsargument of the parentradiate()call.- n_pts
Angular evaluation points. Default
360L.- colour, color
Outline colour. Default
"steelblue".coloris the American-spelling alias.- linewidth
Outline width. Default
0.8.- fill
Fill colour. Default
NA(outline only).- alpha
Opacity. Default
0.8.- display
A `circ_display()` controlling rotation, matching the parent `radiate()` plot. Default `NULL` uses the input's `display` attribute when present, otherwise the identity display.
- axial
Logical; when `TRUE`, draw the axial (bidirectional) density of an axial fit (from `vonmises_fit(axial = TRUE)`): the curve is evaluated on doubled angles, giving two equal peaks at `mu` and `mu + pi`. Default `FALSE`.