The Momocs' LDA
plotter with many graphical options.
# S3 method for LDA
plot(
x,
fac = x$fac,
xax = 1,
yax = 2,
points = TRUE,
col = "#000000",
pch = 20,
cex = 0.5,
palette = col_solarized,
center.origin = FALSE,
zoom = 1,
xlim = NULL,
ylim = NULL,
bg = par("bg"),
grid = TRUE,
nb.grids = 3,
morphospace = FALSE,
pos.shp = c("range", "full", "circle", "xy", "range_axes", "full_axes")[1],
amp.shp = 1,
size.shp = 1,
nb.shp = 12,
nr.shp = 6,
nc.shp = 5,
rotate.shp = 0,
flipx.shp = FALSE,
flipy.shp = FALSE,
pts.shp = 60,
border.shp = col_alpha("#000000", 0.5),
lwd.shp = 1,
col.shp = col_alpha("#000000", 0.95),
stars = FALSE,
ellipses = FALSE,
conf.ellipses = 0.5,
ellipsesax = TRUE,
conf.ellipsesax = c(0.5, 0.9),
lty.ellipsesax = 1,
lwd.ellipsesax = sqrt(2),
chull = FALSE,
chull.lty = 1,
chull.filled = FALSE,
chull.filled.alpha = 0.92,
density = FALSE,
lev.density = 20,
contour = FALSE,
lev.contour = 3,
n.kde2d = 100,
delaunay = FALSE,
loadings = FALSE,
labelspoints = FALSE,
col.labelspoints = par("fg"),
cex.labelspoints = 0.6,
abbreviate.labelspoints = TRUE,
labelsgroups = TRUE,
cex.labelsgroups = 0.8,
rect.labelsgroups = FALSE,
abbreviate.labelsgroups = FALSE,
color.legend = FALSE,
axisnames = TRUE,
axisvar = TRUE,
unit = FALSE,
eigen = TRUE,
rug = TRUE,
title = substitute(x),
box = TRUE,
old.par = TRUE,
...
)
a plot
an object of class "LDA", typically obtained with LDA
name or the column id from the $fac slot, or a formula combining colum names from the $fac slot (cf. examples). A factor or a numeric of the same length can also be passed on the fly.
the first PC axis
the second PC axis
logical whether to plot points
a color for the points (either global, for every level of the fac or for every individual, see examples)
a pch for the points (either global, for every level of the fac or for every individual, see examples)
the size of the points
a palette
logical whether to center the plot onto the origin
to keep your distances
numeric of length two ; if provided along with ylim, the x and y lims to use
numeric of length two ; if provided along with xlim, the x and y lims to use
color for the background
logical whether to draw a grid
and how many of them
logical whether to add the morphological space
passed to morphospace_positions, one of
"range", "full", "circle", "xy", "range_axes", "full_axes"
. Or directly
a matrix of positions. See morphospace_positions
amplification factor for shape deformation
the size of the shapes
(pos.shp="circle") the number of shapes on the compass
(pos.shp="full" or "range) the number of shapes per row
(pos.shp="full" or "range) the number of shapes per column
angle in radians to rotate shapes (if several methods, a vector of angles)
same as above, whether to apply coo_flipx
same as above, whether to apply coo_flipy
the number of points fro drawing shapes
the border color of the shapes
the line width for these shapes
the color of the shapes
logical whether to draw "stars"
logical whether to draw confidence ellipses
numeric the quantile for the (bivariate gaussian) confidence ellipses
logical whether to draw ellipse axes
one or more numeric, the quantiles for the (bivariate gaussian) ellipses axes
if yes, the lty with which to draw these axes
if yes, one or more numeric for the line widths
logical whether to draw a convex hull
if yes, its linetype
logical whether to add filled convex hulls
numeric alpha transparency
whether to add a 2d density kernel estimation (based on kde2d)
if yes, the number of levels to plot (through image)
whether to add contour lines based on 2d density kernel
if yes, the (approximate) number of lines to draw
the number of bins for kde2d, ie the 'smoothness' of density kernel
logical whether to add a delaunay 'mesh' between points
logical whether to add loadings for every variables
if TRUE rownames are used as labels, a colname from $fac can also be passed
a color for these labels, otherwise inherited from fac
a cex for these labels
logical whether to abbreviate
logical whether to add labels for groups
ifyes, a numeric for the size of the labels
logical whether to add a rectangle behind groups names
logical, whether to abbreviate group names
logical whether to add a (cheap) color legend for numeric fac
logical whether to add PC names
logical whether to draw the variance they explain
logical whether to add plane unit
logical whether to draw a plot of the eigen values
logical whether to add rug to margins
character a name for the plot
whether to draw a box around the plotting region
whether to restore the old par. Set it to FALSE
if you want to reuse the graphical window.
useless here, just to fit the generic plot
Widely inspired by the "layers" philosophy behind graphical functions of the ade4 R package.
LDA, plot_CV, plot_CV2, plot.PCA.