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.
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 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 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 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), ...)
the x-axis data
the y-axis data
the colors or a class to set colors, must match the length of
x
and y
.
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.
logical, if TRUE
, then log-transform the y axis
logical, if TRUE
, then reverse the y axis.
set the range of the y-axis. See Details.
logical, if TRUE
, then log-transform the x axis.
set the range of the x-axis. See Details.
set up y-axis labels.
set up x-axis labels.
the x-axis title (also called x-axis caption).
the y-axis title (also called y-axis caption).
the figure caption.
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.
Information about the graph.
Typically used to create a colored scatter plot for numeric x and y data.
Can be used to create a hydrograph where the line is colored by a third variable, or a colored scatter plot over time.
Can be used to create a hydrograph where the line is colored by a third variable, or a colored scatter plot over time.
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.
# 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")
# }
Run the code above in your browser using DataLab