Learn R Programming

prettyGraphs (version 1.0)

prettyPlot: prettyPlot

Description

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

Usage

prettyPlot(data_matrix, x_axis = 1, y_axis = 2, col = NULL, xlab = "", ylab = "", main = "", display_names = TRUE, display_points = TRUE, new_window = TRUE, constraints = NULL, axis_line_width = 3, pos = 3, pch = NULL, cex = 1, textSizes = 0.8, contributionCircles = FALSE, contributions = NULL, flip = FALSE)

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
A single-column matrix of colors for each data point.
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.
new_window
boolean. If TRUE, a new graphics device is created. If FALSE, plotting will occur on current graphics device.
constraints
A list that contains the plot constraints. Default is NULL (constraints are computed each time).
axis_line_width
integer. Determines thickness of axis lines.
pos
integer between 1-4. Determines position of text for points. See par.
pch
an integer. Indicates which point style to use. See par.
cex
a continuous value. Indicates the size of the points. See par.
textSizes
A replacement for the cex parameter in text() (to avoid collisions with cex). See par and text.
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)
flip
boolean. If TRUE, exchanges bg and col for all applicable pch values.

Value

  • Returns a two item list:
  • colA matrix of colors where each element is the color for each item plotted.
  • constraintsA list (from minmaxHelper) of the plot constraints (i.e., min and max for axes)