prettyPlot creates simple, crisp, publication-style quality graphics for multivariate analyses.
prettyPlot(
data_matrix,
x_axis = 1,
y_axis = 2,
col = NULL,
pch = NULL,
cex = NULL,
text.cex = NULL,
pos = 3,
xlab = "",
ylab = "",
main = "",
display_names = TRUE,
display_points = TRUE,
constraints = NULL,
contributionCircles = FALSE,
contributions = NULL,
axes = TRUE,
fg.line.width = 3,
fg.type = "l",
fg.col = "black",
bg.line.width = 1.5,
bg.lty = 3,
bg.col = "black",
flip = FALSE,
asp = 1,
findBounds = TRUE,
dev.new = TRUE,
new.plot = TRUE
)
Returns a three item list:
A matrix of colors where each element is the color for each item plotted.
A matrix of pch values where each element is the pch number for each item plotted.
A list (from
minmaxHelper
) of the plot constraints (i.e., min and max for
axes)
A set of data you would like to plot on 2 dimensions (e.g., a scatter plot). Can be original data or factor scores or anything with at least 2 columns.
Which axis is the x-axis? Default is 1.
Which axis is the y-axis? Default is 2.
any acceptable color format. A single-column matrix of colors for each data point. A single value can be used.
A single-column matrix of pch for each data point. A single value
can be used. Indicates which point style to use for each item. See
par
.
a single column of continuous values. A single value can be used.
Indicates the size of the points. See par
. Used
multiplicatively for points with contributions
.
A replacement for the cex parameter in text() (to avoid
collisions with cex). Used additively for points with contributions
.
See par
and text
.
integer between 1-4. Determines position of text for points. See
par
.
A label to be placed along the x-axis.
A label to be placed along the y-axis.
A title to be placed at the top of the graph.
boolean. If TRUE, the names of the points will be displayed on the plot.
boolean. If TRUE, the points will be displayed on the plot.
A list that contains the plot constraints. Default is NULL (constraints are computed each time).
boolean. If TRUE, items plotted will vary in size, dependent on amount of contribution to the variance.
A matrix of contribution values for data_matrix (should also be the same size & dimensionality as data_matrix)
boolean. If TRUE, a new set of axes are plotted.
integer. Determines thickness of foreground (default:
solid) axis lines, see points
and lwd
under
par
.
character or string Determines type of points for foreground
(default: solid) axis lines, see points
and type
under
par
.
any acceptable color format. Determines color for foreground
(default: solid) axis lines, see points
and col
under
par
.
integer. Determines thickness of background (default:
dashed) axis lines, see abline
and lwd
under
par
.
integer. Determines type of background (default: dashed) axis
lines, see abline
and lty
under par
.
any acceptable color format. Determines color of background
(default: dashed) axis lines, see abline
and col
under
par
.
boolean. If TRUE, exchanges bg and col for all applicable pch values.
numeric. Aspect ratio, see par
.
boolean. If TRUE, finds the min and max of each plotted axes. If FALSE, the largest value is used for all constraints.
boolean. If TRUE, dev.new
is called internally
to create new device. If FALSE, a device must already be open.
boolean. If TRUE, plot
is called for a new
plot on the current device. If FALSE, items will be overlayed much like
points
.
Derek Beaton
All items after contributions (i.e., axes onward) are parameters for very fine-grained detail. They are quite powerful but in most cases not required.