colorPlot: Plot Data

Description Usage Arguments Details Value Methods Note See Also Examples

Description

Produces a line/scatter plot where each point or group of related points has a unique color or where sections along a line have different colors.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
colorPlot(x, y, color, Plot = list(), yaxis.log = FALSE,
  yaxis.rev = FALSE, yaxis.range = c(NA, NA), xaxis.log = FALSE,
  xaxis.range = c(NA, NA), ylabels = 7, xlabels = 7, xtitle = "",
  ytitle = "", caption = "", margin = c(NA, NA, NA, NA), ...)

## S4 method for signature 'numeric,numeric'
colorPlot(x, y, color, Plot = list(name = "Auto",
  what = "points", symbol = "circle", filled = TRUE, size = 0.09, color =
  "Auto", groups = 4, ramp = "greenRed"), yaxis.log = FALSE,
  yaxis.rev = FALSE, yaxis.range = c(NA, NA), xaxis.log = FALSE,
  xaxis.range = c(NA, NA), ylabels = 7, xlabels = 7,
  xtitle = deparse(substitute(x)), ytitle = deparse(substitute(y)),
  caption = "", margin = c(NA, NA, NA, NA), ...)

## S4 method for signature 'Date,numeric'
colorPlot(x, y, color, Plot = list(name = "Auto",
  what = "lines", symbol = "circle", filled = TRUE, size = 0.09, color = "Auto",
  groups = 10, ramp = "greenRed"), yaxis.log = FALSE, yaxis.rev = FALSE,
  yaxis.range = c(NA, NA), xaxis.log = FALSE, xaxis.range = range(x, na.rm
  = TRUE), ylabels = 7, xlabels = "Auto", xtitle = "",
  ytitle = deparse(substitute(y)), caption = "", margin = c(NA, NA, NA,
  NA), ...)

## S4 method for signature 'POSIXt,numeric'
colorPlot(x, y, color, Plot = list(name = "Auto",
  what = "lines", symbol = "circle", filled = TRUE, size = 0.09, color = "Auto",
  groups = 10, ramp = "greenRed"), yaxis.log = FALSE, yaxis.rev = FALSE,
  yaxis.range = c(NA, NA), xaxis.log = FALSE, xaxis.range = range(x, na.rm
  = TRUE), ylabels = 7, xlabels = "Auto", xtitle = "",
  ytitle = deparse(substitute(y)), caption = "", margin = c(NA, NA, NA,
  NA), ...)

Arguments

x

the x-axis data

y

the y-axis data

color

the colors or a class to set colors, must match the length of x and y.

Plot

tagged list of control parameters of the plot: name="Auto" means derive class names from the argument color, otherwise, must be a tagged list of color=name, ... (in which case the color tag is not used); what can be only "points" or "lines" in the current version; color="Auto" means if the argument color is double or dateLike create groups of classes, otherwise create unique colors, alternate values are "Range" (treat like double), tagged list of group_name=color, and so forth, "Discrete" valid only for numeric, or "Index" valid only for integer or for specified colors. No usable explanation is generated when color is set to "Index"—use repeated calls to addXY if an explanation is needed and specific colors are supplied.

yaxis.log

logical, if TRUE, then log-transform the y axis

yaxis.rev

logical, if TRUE, then reverse the y axis.

yaxis.range

set the range of the y-axis. See Details.

xaxis.log

logical, if TRUE, then log-transform the x axis.

xaxis.range

set the range of the x-axis. See Details.

ylabels

set up y-axis labels.

xlabels

set up x-axis labels.

xtitle

the x-axis title (also called x-axis caption).

ytitle

the y-axis title (also called y-axis caption).

caption

the figure caption.

margin

set the plot area margins, in units of lines of text. Generally all NA or the output from setGraph if appropriate.

...

arguments for specific methods.

Details

For linear axes, the range can be set to virtually any pair of values. For log axes, the choice of range is more resticted—for less than one log-cycle, powers of whole numbers can be used; from 1 to about 3 log cycles, the choces should be powers of 3 or 10; and for more than 3 log cycles, the range sould be expressed only in powers of 10.

Added from smwrGraphs.

Value

Information about the graph.

Methods

signature(x = "numeric", y = "numeric"))

Typically used to create a colored scatter plot for numeric x and y data.

signature(x = "Date", y = "numeric")

Can be used to create a hydrograph where the line is colored by a third variable, or a colored scatter plot over time.

signature(x = "POSIXt", y = "numeric")

Can be used to create a hydrograph where the line is colored by a third variable, or a colored scatter plot over time.

Note

A call should be made to setPage to set up the graphics environment before calling colorPlot.

See Also

setPage, xyPlot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
set.seed(1)
X <- rnorm(32)
Y <- X + rnorm(32)
Z <- sqrt(X^2 + Y^2) # distance from origin
setGD()
# All defaults: color ramp from Z
colorPlot(X, Y, Z)
# See for examples of colorPlot:
vignette(topic="LineScatter", package="smwrGraphs")

## End(Not run)

leppott/baytrends033 documentation built on July 28, 2018, 10:30 p.m.