plot.factorial: Plot function for factorial-class

plot.factorialR Documentation

Plot function for factorial-class

Description

Plot PCA, CA or MCA.

Usage

## S3 method for class 'factorial'
plot(
  x,
  type = c("ind", "cor", "eig"),
  axes = c(1, 2),
  col = NULL,
  pch = NULL,
  labels = FALSE,
  legendpos = "topleft",
  ...
)

Arguments

x

The PCA, CA or MCA result (object of class factorial-class).

type

The graph to plot.

axes

The factorial axes to be printed (numeric vector).

col

Color(s) of the individuals (type = "ind"). If NULL (the default) and a qualitative supplementary variable was given, the individuals are colored by it, as plotdata does; otherwise any value the base col parameter accepts, so that an external clustering can be used.

pch

Point style(s) of the individuals on the scatter plot (type = "ind", PCA only – plot.CA and plot.MCA, which draw the CA and MCA plots, have no equivalent argument). Same default/auto-detection logic as col. Accepts the same values as the base pch graphical parameter.

labels

Whether the row names are shown instead of points (type = "ind").

legendpos

Position of the legend (type = "ind", PCA only, when individuals are colored by a qualitative variable).

...

Other parameters.

See Also

CA, MCA, PCA, plotdata, plot.CA, plot.MCA, plot.PCA, factorial-class

Examples

require (datasets)
data (iris)
pca = PCA (iris, quali.sup = 5)
plot (pca) # Automatically colored/legended by the qualitative supplementary variable
plot (pca, type = "cor")
plot (pca, type = "eig")
# Overriding colors and point styles manually (e.g. by an external clustering)
km = KMEANS (iris [, -5], k = 3)
plot (pca, col = km$cluster + 1, pch = km$cluster + 1)

fdm2id documentation built on Aug. 28, 2026, 9:07 a.m.