Skip to contents

The autoplot() and plot() methods for "phylepic" objects assemble various panels into the final plot. To facilitate customisations, the plots from each panel can be overwritten. Some effort is made to ensure that the specified plots will look reasonable when assembled.

Usage

# S3 method for class 'phylepic'
plot(
  x,
  ...,
  plot.tree = plot_tree(),
  plot.bars = plot_bars(),
  plot.calendar = plot_calendar(),
  plot.epicurve = plot_epicurve(),
  scale.date = NULL,
  scale.fill = NULL,
  width.tree = 10,
  width.bars = 1,
  width.date = 5,
  width.legend = 2,
  height.tree = 2
)

# S3 method for class 'phylepic'
autoplot(
  object,
  ...,
  plot.tree = plot_tree(),
  plot.bars = plot_bars(),
  plot.calendar = plot_calendar(),
  plot.epicurve = plot_epicurve(),
  scale.date = NULL,
  scale.fill = NULL,
  width.tree = 10,
  width.bars = 1,
  width.date = 5,
  width.legend = 2,
  height.tree = 2
)

Arguments

...

Ignored.

plot.tree

ggplot for the tree panel (see plot_tree).

plot.bars

ggplot for the metadata bars panel (see plot_bars).

plot.calendar

ggplot for the calendar panel (see plot_calendar).

plot.epicurve

ggplot for the epidemic curve panel (see plot_epicurve).

scale.date

A date scale passed to both the calendar and epicurve panels (see ggplot2::scale_x_date).

scale.fill

A fill scale passed to both the calendar and epicurve panels (see ggplot2::scale_x_date).

width.tree

Relative width of the tree panel.

width.bars

Relative width of the metadata bars panel.

width.date

Relative width of the calendar panel.

width.legend

Relative width of the legend, if present.

height.tree

Relative height of the tree panel.

object, x

Object of class "phylepic".

Value

plot() is usually called to display the plot, whereas autoplot() returns a "ggplot" object that can later be displayed with print().

Details

In general, if you wish to suppress a panel from the plot, set the corresponding plot.* argument to NULL. To customise it, use the corresponding plot_*() function, which returns a ggplot plot. You can then add new layers or themes to that plot. See vignette("phylepic") for examples.

Legends from all panels are collected and de-duplicated. They are drawn on the right edge of the overall plot.

See also

Other phylepic plots: plot_bars(), plot_calendar(), plot_epicurve(), plot_tree()