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)
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
.
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.
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.
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)
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.