[R] 3 levelplots and 1 colorbar

Deepayan Sarkar deepayan.sarkar at gmail.com
Fri Mar 26 12:55:38 CET 2010


On Fri, Mar 26, 2010 at 12:46 AM, Joaquin Rapela <rapela at usc.edu> wrote:
>
> I want to create a simple plot containing three levelplots with one colorbar.
> I used the "Three levelplots" code below, but the third levelplot is drawn
> smaller than the first two. However, if I try the "Two levelplots" code below
> it works well. Can anybody tell me how could I draw three levelplots (of the
> same size) with one colorbar.
>
> Thanks in advance, Joaquin
>
> ### Three levelplots ###
> frame <- matrix(rnorm(16*48), nrow=16)
>
> p <-levelplot(frame, colorkey=FALSE)
> print(p, position=c(0,0,1/3,1), more=TRUE)
> p <-levelplot(frame, colorkey=FALSE)
> print(p, position=c(1/3,0,2/3,1), more=TRUE)
> p <-levelplot(frame, colorkey=TRUE)
> print(p, position=c(2/3,0,3/3,1), more=FALSE)

Just out of curiosity, if you have a common color key, why is a
(single) multipanel levelplot not appropriate?

-Deepayan



More information about the R-help mailing list