Displaying 1 result from an estimated 1 matches for "ranrect".
Did you mean:
nrect
2006 Nov 13
1
bug in lrect [lattice]?
...:::grid.rect(x = x, y = y, width = width, height = height,
default.units = "native",
just = just, hjust = hjust, vjust = vjust, gp = grid:::gpar(fill
= col,
col = border, lty = lty, lwd = lwd, alpha = alpha,
...))
}
ranrect <- function(s,fun=lrect) {
coords <- runif(2,s/2,1-s/2)
fun(coords[1]-s/2,coords[2]-s/2,coords[1]+s/2,coords[2]+s/2,
border="red",lwd=2)
}
library(lattice)
## with original lrect: border is black rather than red
xyplot(y~x,
panel=function(...) {
panel.xy...