Scatter plot of 2-dimensional data

PCMPlotTraitData2D(
  X,
  tree,
  sizePoints = 2,
  alphaPoints = 1,
  labeledTips = NULL,
  sizeLabels = 8,
  nudgeLabels = c(0, 0),
  palette = PCMColorPalette(PCMNumRegimes(tree), PCMRegimes(tree)),
  scaleSizeWithTime = !is.ultrametric(tree),
  numTimeFacets = if (is.ultrametric(tree) || scaleSizeWithTime) 1L else 3L,
  nrowTimeFacets = 1L,
  ncolTimeFacets = numTimeFacets
)

Arguments

X

a k x N matrix

tree

a phylo object

sizePoints, alphaPoints

numeric parameters passed as arguments size and alpha to geom_point. Default: sizePoints = 2, alphaPoints = 1.

labeledTips

a vector of tip-numbers to label (NULL by default)

sizeLabels

passed to geom_text to specify the size of tip-labels for the trait-points.

nudgeLabels

a numeric vector of two elements (default: c(0,0)), passed as arguments nudge_x and nudge_y of geom_text.

palette

a named vector of colors

scaleSizeWithTime

logical indicating if the size and the transparency of the points should reflect the distance from the present (points that are farther away in time with respect to the present moment, i.e. closer to the root of the tree, are displayed smaller and more transparent.). By default this is set to !is.ultrametric(tree).

numTimeFacets

a number or a numeric vector controlling the creation of different facets corresponding to different time intervals when the tree is non-ultrametric. If a single number, it will be interpreted as an integer specifying the number of facets, each facets corresponding to an equal interval of time. If a numeric vector, it will be used to specify the cut-points for each interval. Default: if(is.ultrametric(tree) || scaleSizeWithTime) 1L else 3.

nrowTimeFacets, ncolTimeFacets

integers specifying how the time facets should be layed out. Default: nrowTimeFacets = 1L, ncolTimeFacets = numTimeFacets.

Value

a ggplot object