[R] xyplot without external box
Mauricio Zambrano-Bigiarini
hzambran.newsgroups at gmail.com
Thu Mar 8 14:02:50 CET 2012
Dear list members,
Within a loop, I need to create an xyplot with only a legend, not even
with the default external box drawn by lattice.
I already managed to remove the axis labels and tick marks, but I
couldn't find in the documentation of xyplot how to remove the
external box.
I would really appreciate any help with this
------------- START -----------
library(lattice)
x<-1:100
cuts <- unique( quantile( as.numeric(x),
probs=c(0, 0.25, 0.5, 0.75, 0.9, 0.95, 1),
na.rm=TRUE) )
gof.levels <- cut(x, cuts)
nlevels <- length(levels(gof.levels))
xyplot(1~1, groups=gof.levels, type="n", xlab="", ylab="",
scales=list(draw=FALSE),
key = list(x = .5, y = .5, corner = c(0.5, 0.5),
title="legend",
points = list(pch=16, col=c(2,4,3), cex=1.5),
text = list(levels(gof.levels))
)
)
------------- END -----------
Thanks in advance,
Mauricio Zambrano-Bigiarini
--
============================================
FLOODS Action
Water Resources Unit (H01)
Institute for Environment and Sustainability (IES)
European Commission, Joint Research Centre (JRC)
webinfo : http://floods.jrc.ec.europa.eu/
============================================
DISCLAIMER:
"The views expressed are purely those of the writer
and may not in any circumstances be regarded as stating
an official position of the European Commission."
============================================
Linux user #454569 -- Ubuntu user #17469
============================================
"There is only one pretty child in the world,
and every mother has it."
(Chinese Proverb)
============================================
http://c2.com/cgi/wiki?HowToAskQuestionsTheSmartWay
More information about the R-help
mailing list