Displaying 2 results from an estimated 2 matches for "colorseq".
2008 Jan 01
2
Alignment and Labeling of a color key in a xyplot?
...axis, so it should be vertically printed and located to the right of
the color key. I tried to give the 'key' argument in 'draw.colorkey'
some arguments, but I could not manage to put a label on the color key.
Thanks very much.
Marius
library(lattice)
library(grid)
x=c(1,2,3)
colorseq=c(0.2,0.5,0.8)
mycolors=gray(colorseq)
#trellis.device(postscript,horizontal=F,onefile=F,file="~/testplot.ps")
xyplot(x~x,col=mycolors,aspect=1)
draw.colorkey(key=list(at=seq(1,3,length=4),col=mycolors,text=list(c
("test"))),draw=TRUE,vp=viewport(x=1,y=0.6,height=0.8))
#dev.off...
2007 Dec 25
1
both lines and plot characters in a lattice plot key
...(instead of a
single color), matching the colors in my specified variable "colors"
if possible, i.e. a single line segment starting from light gray and
ending with a dark gray.
Thanks very much in advance!
Jan
library(lattice)
x=c(1,2,3,4,5)
y=c(5,4,3,2,1)
symbolvec=c(3,3,3,1,3)
colorseq=seq(0.25,0.88,length=5)
colors=gray(colorseq)
colorvec=colors
xyplot(y~x,
panel=function(...){
panel.xyplot(...,type="n")
lpoints(x,y,pch=symbolvec,col=colorvec)
},
key=list(x=0.2,y=0.2,lines=list(lty=c(0,0,1)),points=list(pch=c
(1,3,26)),text=list(c("key 1","key 2&q...