Description Usage Arguments Details Value Note See Also Examples
Automatically places a key in the sparsest location of the space spanned by the the x and y input coordinates.
1 |
x |
if |
args. |
a list of arguments that define the legend ala the |
nquadrant |
an integer denoting the number of quadrants to partition
the space spanned by x and y. For example, if |
y |
a numeric vector containing the ordinate (y-axis) values
in the current plot. If |
The argument args.
is a list
of arguments that define the key and nquadrant
is the number of equi-sized quadrants to use in dividing
the space in both the x- and y-direction. e.g., if
nquadrant=3, the x-y plane is partitioned into a
3x3 uniform grid and the position of the sparsest
quadrant (as defined by sparsetQuadrant
)
is used to place the key. This function
does not take into consideration lines connecting
the data points and only considers the spatial distribution
of the points in the x-y plane. Futhermore, this function
assumes that par("usr")
is approximately c(range(x),range(y))
,
i.e., that the user will not explicitly make space outside
span of the data to place the key. In this case, the user
should explicitly place the key as usual.
no output is returned.
The key as described by args.
is positioned in estimated sparsest
region of the specified data set.
autoText
, sparsestQuadrant
, mergeList
.
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 32 33 34 35 36 37 38 39 | zkey <- list(x=-1,y=-1,
lines=list(type=c("o","l"), pch=c(18,0), lty=1, col=1:2),
border=1,
corner=c(1,1),
cex=1.5 )
old.mfrow <- par(mfrow=c(2,2))
## rectangular hole in cloud
set.seed(100)
N <- 10024
y <- rnorm(N)
x <- seq(N)
xhole <- x > .4*N & x < .9*N
yhole <- y > -2 & y < 2
hole <- xhole & yhole
y <- y[!hole]
x <- x[!hole]
plot(x, y, type="p")
autoKey(x, y, args=zkey)
## linear chirp (more room on left)
y <- sin(.125*pi*100*((0:99)/100)^2)
plot(y, type="p")
autoKey(y, args=zkey)
## quadratic
x <- seq(-5,5)
y <- x^2
plot(x,y,type="p")
autoKey(x, y, args=zkey)
## circle
tt <- seq(0,2*pi,length=100)
x <- sin(tt)
y <- cos(tt)
plot(x, y, type="p")
autoKey(x, y, args=zkey)
par(old.mfrow)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.