search for: colorvec

Displaying 3 results from an estimated 3 matches for "colorvec".

2009 Dec 20
1
How to put text outside an xyplot?
...be simple, but I just couldn't figure out how to do it. How does this work? Cheers, Marius library(lattice) library(grid) myvec=1:10 data=data.frame(x=myvec,y=myvec) mygray=function(l) gray(seq(0.2,0.8,length=l)) colors=level.colors(data[1:10,2],at=do.breaks(c(1,10),10),col.regions=mygray) colorvec=colors[1:10] #trellis.device(postscript,color=F,horizontal=F,onefile=F) xyplot(data[,2]~data[,1],aspect=1, panel=function(...){ panel.xyplot(...,type="n") lpoints(data[,1],data[,2],pch=1,col=colorvec) grid.text("text to the right of the color key",1.2,0.5,rot=90)#does not...
2007 Dec 25
1
both lines and plot characters in a lattice plot key
...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","key 3")),align=T,transparent=T))
2012 May 03
1
Simple plot loop
Trying to plot multiple lines from a simple matrix with headers (eight observations per column). I will be doing a number of these, with varying numbers of columns, and do not want to enter the header names for each one (I got frustrated and just wrote them out, which did work). Data reads fine, first plot is fine, but when i use the code at the bottom for a for i loop it tells me that x and y