prettyPlot | R Documentation |
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
)
data_matrix |
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. |
x_axis |
Which axis is the x-axis? Default is 1. |
y_axis |
Which axis is the y-axis? Default is 2. |
col |
any acceptable color format. A single-column matrix of colors for each data point. A single value can be used. |
pch |
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
|
cex |
a single column of continuous values. A single value can be used.
Indicates the size of the points. See |
text.cex |
A replacement for the cex parameter in text() (to avoid
collisions with cex). Used additively for points with |
pos |
integer between 1-4. Determines position of text for points. See
|
xlab |
A label to be placed along the x-axis. |
ylab |
A label to be placed along the y-axis. |
main |
A title to be placed at the top of the graph. |
display_names |
boolean. If TRUE, the names of the points will be displayed on the plot. |
display_points |
boolean. If TRUE, the points will be displayed on the plot. |
constraints |
A list that contains the plot constraints. Default is NULL (constraints are computed each time). |
contributionCircles |
boolean. If TRUE, items plotted will vary in size, dependent on amount of contribution to the variance. |
contributions |
A matrix of contribution values for data_matrix (should also be the same size & dimensionality as data_matrix) |
axes |
boolean. If TRUE, a new set of axes are plotted. |
fg.line.width |
integer. Determines thickness of foreground (default:
solid) axis lines, see |
fg.type |
character or string Determines type of points for foreground
(default: solid) axis lines, see |
fg.col |
any acceptable color format. Determines color for foreground
(default: solid) axis lines, see |
bg.line.width |
integer. Determines thickness of background (default:
dashed) axis lines, see |
bg.lty |
integer. Determines type of background (default: dashed) axis
lines, see |
bg.col |
any acceptable color format. Determines color of background
(default: dashed) axis lines, see |
flip |
boolean. If TRUE, exchanges bg and col for all applicable pch values. |
asp |
numeric. Aspect ratio, see |
findBounds |
boolean. If TRUE, finds the min and max of each plotted axes. If FALSE, the largest value is used for all constraints. |
dev.new |
boolean. If TRUE, |
new.plot |
boolean. If TRUE, |
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.
Returns a three item list:
col |
A matrix of colors where each element is the color for each item plotted. |
pch |
A matrix of pch values where each element is the pch number for each item plotted. |
constraints |
A list (from
|
Derek Beaton
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.