plot.fhx: Plot an 'fhx' object

Description Usage Arguments See Also Examples

View source: R/plotting.R

Description

Plot an fhx object

Usage

1
2
## S3 method for class 'fhx'
plot(...)

Arguments

...

Arguments passed on to plot_demograph().

See Also

plot_demograph() is what does the actual plotting.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
data(lgr2)
plot(lgr2)

plot(lgr2, ylabels = FALSE, plot_legend = TRUE)

data(lgr2_meta)
# With color showing species.
plot(lgr2,
  color_group = lgr2_meta$SpeciesID,
  color_id = lgr2_meta$TreeID,
  plot_legend = TRUE
)
# With facets for each species.
plot(lgr2,
  facet_group = lgr2_meta$SpeciesID,
  facet_id = lgr2_meta$TreeID,
  plot_legend = TRUE
)

# Append annotation onto a ggplot object.
require(ggplot2)
p <- plot_demograph(lgr2,
  color_group = lgr2_meta$SpeciesID,
  color_id = lgr2_meta$TreeID
)
# Add transparent box as annotation to plot.
p + annotate("rect",
  xmin = 1750, xmax = 1805,
  ymin = 3.5, ymax = 13.5, alpha = 0.2
)

Example output

Loading required package: ggplot2

burnr documentation built on March 10, 2021, 5:07 p.m.