Produce high-quality scatter plots
Plotting function with scads of options for creating high quality scatter
plots. Can be used with screenPage
.
scatterPlot(x, y, plotType = "p", lineType = "solid", lineWidth = 1.5, plotChar = "*", dataCex = 1, color = "black", xAxisMin = NULL, xAxisMax = NULL, xExpandBy = 0.04, xTicks = 5, xTickLocations = NULL, labelXTicks = TRUE, xTickLabels = NULL, xCex = 1, xAxisLabel = NULL, labelXAxis = TRUE, xSpace = 4, yAxisMin = NULL, yAxisMax = NULL, yExpandBy = 0.04, yTicks = 5, yTickLocations = NULL, yTickLabels = NULL, labelLeftTicks = FALSE, labelRightTicks = TRUE, yCex = 1, extendTopTick = TRUE, leftAxisLabel = NULL, rightAxisLabel = NULL, labelLeftAxis = TRUE, labelRightAxis = FALSE, cex = 1, head = NULL, headAlign = 0.5, headCex = 1.5, sub = NULL, subCex = 0.85, leftTopLabel = NULL, rightTopLabel = NULL, topLabelAlign = 0, labCex = 1, leftInsideLabel = NULL, rightInsideLabel = NULL, innerOffset = 0.05, innerCex = 0.8, foot = NULL, footAlign = 0, footCex = 0.8, footSpace = -1, tck = 0.03, axisWidth = 2, boxType = "u", leftMargin = -1, rightMargin = -1, topMargin = -1, bottomMargin = -1)
x |
the x coordinates of points in the plot. If this is a string, the
function |
y |
the y coordinates of points in the plot. If this is a string, the
function |
plotType |
type of plot desired. Values are |
lineType |
character or numeric vector specifying the line type if
|
lineWidth |
default is |
plotChar |
character (or number for plotting symbols – see the help for
|
dataCex |
|
color |
string or number. Default is 1, the device default foreground color. |
xAxisMin |
minimum value of the x axis. If non-NULL, this overrides the
calculation described in |
xAxisMax |
maximum value of the x axis. If non-NULL, this overrides the
calculation described in |
xExpandBy |
a single number or two numbers between 0 and 1. |
xTicks |
number of ticks to draw on x axis at "pretty" locations. Default
is 5. This argument is ignored if |
xTickLocations |
if non-NULL, a vector of desired tick locations or a string that
evaluates to such a vector. The default value NULL lets the setting
for |
labelXTicks |
If |
xTickLabels |
character vector of tick labels or NULL (the default). If NULL and
|
xCex |
|
xAxisLabel |
text to appear centered under the x axis. Default value NULL creates
a string by deparsing the |
labelXAxis |
if |
xSpace |
lines of space to set aside directly beneath the x-axis to hold
tick, year and/or axis labels. Default is |
yAxisMin |
minimum value of the y axis. If non-NULL, this overrides the
calculation described in |
yAxisMax |
maximum value of the y axis. If non-NULL, this overrides the
calculation described in |
yExpandBy |
a single number or two numbers between 0 and 1. |
yTicks |
number of ticks to draw on y axis at "pretty" locations. Default
is 5. This argument is ignored if |
yTickLocations |
if non-NULL, a vector of desired tick locations or a string that
evaluates to such a vector. The default value NULL lets the setting
for |
yTickLabels |
character vector of tick labels or NULL (the default). If NULL and
|
labelLeftTicks |
If |
labelRightTicks |
If |
yCex |
|
extendTopTick |
if |
leftAxisLabel |
text to appear centered outside the left axis.
Default value NULL creates a string by deparsing the |
labelLeftAxis |
if |
rightAxisLabel |
text to appear centered outside the right axis.
Default value NULL creates a string by deparsing the |
labelRightAxis |
if |
cex |
the base character expansion factor by which all of the
|
head |
text to appear at the top of the figure region, with alignment
determined by |
headAlign |
number indicating justification for the strings in |
headCex |
|
sub |
text to appear just under |
subCex |
|
leftTopLabel |
text to appear at the top of the left axis, with alignment
determined by |
rightTopLabel |
text to appear at the top of the right axis, with alignment
determined by |
topLabelAlign |
number indicating alignment for the strings in |
labCex |
|
leftInsideLabel |
text to appear left justified and just inside the upper left corner of the plot region. No default. |
rightInsideLabel |
text to appear right justified and just inside the upper right corner of the plot region. No default. |
innerOffset |
number between 0 and 1, a fractional offset for the inside labels.
The left edge of |
innerCex |
|
foot |
text to appear at the bottom of the figure region, with alignment
determined by |
footAlign |
number indicating justification for the strings in |
footCex |
|
footSpace |
lines of space to set aside directly beneath the space allocated by
|
tck |
length of major tick marks in inches. Minor ticks are 2/3 as long. Default is 0.03. |
axisWidth |
line width for the axes and box (if any). Default is 2. |
boxType |
character representing the type of box. Characters |
leftMargin |
lines of space for the left margin. Default value (-1) figures this out automatically. |
rightMargin |
lines of space for the right margin. Default value (-1) figures this out automatically. |
topMargin |
lines of space for the top margin. Default value (-1) figures this out automatically. |
bottomMargin |
lines of space for the bottom margin. Default value (-1) figures this out automatically. |
Each of the text items head
, sub
, leftTopLabel
,
rightTopLabel
, leftInsideLabel
, rightInsideLabel
,
foot
, leftAxisLabel
, rightAxisLabel
and
xAxisLabel
can be given as a string, a collections of strings,
or as a string that gets evaluated to one of the first two. Multiple
strings are drawn on successive lines.
scatterPlot
invisibly returns a list of class "scatterPlot" and
elements named xy
(a matrix containing x
and y
in
two columns), plotType
, lineType
, color
,
plotChar
, lineWidth
, x
(x coordinate for legend),
y
(y coordinate for legend), xRange
, yRange
,
innerCex
and par
.
This list is useful mostly as an argument to legend
.
scatterPlot
is a companion to tisPlot
. Both are
designed to be driven from a graphical user interface.
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.