[R] levelplot add line

Jeff Jorgensen jcjorgensen at wisc.edu
Wed Feb 25 21:00:37 CET 2004


Thanks for putting me on the right track.  Sorry to be bothersome with 
another follow-up, but the code that calls the panel function (see below) 
doesn't seem to be working.  What am I doing wrong?

Thanks,

Jeff

levelplot(matrix,contour=T, cuts=15,at=seq(...), labels=T, region=T,
                             scales=list(x=list(at=xlocations,labels=as.character(xlabels)),
                                         y=list(at=ylocations, 
labels=as.character(ylabels))),
                             xlim=c(1:368), ylim=c(1:31),
                             colorkey = list(space = "bottom",
                                             labels = list(at = 
seq(0,2000,200),
                                             lab = seq(0,2000,200))), #If I 
cut it off here, it works fine
         panel=function(x,y,z){
                             panel.levelplot(x=c(...), y=c(...), z=matrix,
                             cuts=15,at=seq(...), contour=T, labels=T,
                             region=T,
                             subscripts=seq(...),
                             col.regions=cm.colors(100),
                             zcol=c(1:100),
                             panel.abline(h=200))
             })



At 08:34 AM 2/25/2004 -0600, you wrote:
>On Wednesday 25 February 2004 08:13, Jeff Jorgensen wrote:
> > Deepayan,
> >
> > Thanks for the quick response.  Just to make sure I understand, let me
> > explain in a bit more detail what I am trying to do.
> >
> > I have created a levelplot (with contour lines and colored regions), and
> > what I am trying to figure out now is how to add a series of horizontal
> > lines across the levelplot and also assign values or labels to the lines
> > on the alternative y-axis.  Would I do this with the route you suggest
> > below?
>
>For adding the lines, yes. Take a look at ?panel.functions and ?llines.
>
>I'm not sure what you mean by 'assign values or labels to the lines on the
>alternative y-axis'. As a general rule, panel regions are 'clipped', i.e.,
>any attempt by the panel function to draw outside the panel has no effect.
>This can be overridden by with lset(list(clip = list(panel = FALSE))), but
>I wouldn't recommend using it unless you know what you are doing.
>
>Deepayan




More information about the R-help mailing list