nos.xyplot {NostalgiR} | R Documentation |
nos.xyplot text-based scatter plot.
Description
Plots a text-based scatter plot, with the option of having a regression line, or a linear interpolation of the points.
Usage
nos.xyplot(x = 1:length(y), y, xlab = NULL, ylab = NULL, ratio = 0.25,
width = round(options()$width * 0.8), height = round(ratio * width),
pch = c("o", "~"), type = "p")
Arguments
x |
A numeric vector containing the x-values to be plotted. |
y |
A numeric vector containing the y-values to be plotted. |
xlab |
Label of the x-axis of the plot. |
ylab |
Label of the y-axis of the plot. |
ratio |
Coefficient that controls the aspect ratio of the plot. |
width |
Width of the plot in points. |
height |
Height of the plot in points. |
pch |
A two dimensional vector of single-character symbols. The first symbol is for the x and y coordinate points, and the second symbol is for the interpolation or regression line. |
type |
One of the values in the set |
Note
Due to rounding to a relatively crude grid results can only be approximate. The equally spaced axis ticks, for example, may be non-equally spaced in the plot. Further, due to the crude grid also there might be several points per character. The function uses the same plotting symbol no matter how many points coincide on one character position.
Author(s)
Hien D. Nguyen
See Also
Examples
## Plot 10 correlated points
x <- 10*runif(10)
y <- x + rnorm(10)
nos.xyplot(x,y,type='p',xlab='x',ylab='y')
## Plot 10 correlated points with a regression line
x <- 10*runif(10)
y <- x + rnorm(10)
nos.xyplot(x,y,type='pr',xlab='x',ylab='y')
## Plot 10 correlated points with a linear interpolation
x <- 10*runif(10)
y <- x + rnorm(10)
nos.xyplot(x,y,type='lp',xlab='x',ylab='y')