prettyPlot: prettyPlot

Description Usage Arguments Details Value Author(s)

View source: R/prettyPlot.R

Description

prettyPlot creates simple, crisp, publication-style quality graphics for multivariate analyses.

Usage

1
2
3
4
5
6
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)

Arguments

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

cex

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.

text.cex

A replacement for the cex parameter in text() (to avoid collisions with cex). Used additively for points with contributions. See par and text.

pos

integer between 1-4. Determines position of text for points. See par.

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 points and lwd under par.

fg.type

character or string Determines type of points for foreground (default: solid) axis lines, see points and type under par.

fg.col

any acceptable color format. Determines color for foreground (default: solid) axis lines, see points and col under par.

bg.line.width

integer. Determines thickness of background (default: dashed) axis lines, see abline and lwd under par.

bg.lty

integer. Determines type of background (default: dashed) axis lines, see abline and lty under par.

bg.col

any acceptable color format. Determines color of background (default: dashed) axis lines, see abline and col under par.

flip

boolean. If TRUE, exchanges bg and col for all applicable pch values.

asp

numeric. Aspect ratio, see par.

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, dev.new is called internally to create new device. If FALSE, a device must already be open.

new.plot

boolean. If TRUE, plot is called for a new plot on the current device. If FALSE, items will be overlayed much like points.

Details

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.

Value

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 minmaxHelper) of the plot constraints (i.e., min and max for axes)

Author(s)

Derek Beaton


prettyGraphs documentation built on May 1, 2019, 9:25 p.m.