scalePlot: Scale Plot

View source: R/scalePlot.R

scalePlotR Documentation

Scale Plot

Description

Produces a graph with a fixed aspect ratio for the x- and y-axes.

Usage

scalePlot(x, y, scale = 1, Plot = list(name = "", what = "lines", type
  = "solid", width = "standard", symbol = "circle", filled = TRUE, size =
  0.09, color = "black"), 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))

Arguments

x

the x-axis data.

y

the y-axis data.

scale

the y/x ratio. See Details.

Plot

parameters defining the characteristics of the plot. See setPlot for a description of the parameters.

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 the y-axis labels. See linearPretty for details.

xlabels

set the y-axis labels. See linearPretty for details.

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.

Details

The scale argument sets the scaling ratio of the y-axis to the x-axis. For latitude and longitude data, set the scale to 1/cos(midlat/180*pi), where midlat is the midrange of the latitude.

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.

Value

Information about the graph.

Note

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

See Also

setPage, xyPlot

Examples

## Not run: 
set.seed(1)
X <- rnorm(32)
Y <- X + rnorm(32)
setGD()
scalePlot(X, Y, Plot=list(what="points", size=0.05))
# For more details of scalePlot see
vignette(topic="LineScatter", package="smwrGraphs")

## End(Not run)

USGS-R/smwrGraphs documentation built on Oct. 11, 2022, 6:11 a.m.