[R] several image.plots with same axis (maximum)

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Jan 25 08:15:28 CET 2008


You haven't told us where you found image.plot(): it is not part of base R 
and you cannot expect R-help readers to know the content of every package.
At a guess, this is from package 'fields'.  See the posting quide for the 
minimum information that we request for every posting.

I don't think you are talking about an 'axis' at all, but the range of 
the z values in a legend.  If this were an image() plot, you need to set 
'zlim', and fields:::image.plot is just a wrapper for image().

On Fri, 25 Jan 2008, mdgi at gmx.ch wrote:

> Hello R freaks
>
> I have the following problem:
>
> I have several image plots, that need to have the same axis. i want to 
> specify the range from 0 to a maximum value. The problem is, that the 
> axis then only goes to the highest value of the respective plot. E.g: 
> this is a modified example from the help file "image.plot" z values go 
> until 25. My maximum in plot two is set to 30, so I want the first one 
> to be the same range:
>
> par(mfrow=c(1,2))
>
> x<- 1:10; y<- 1:15; z<- outer( x,y,"+") #define array
> whiteblack = colorRampPalette(c("white", "black"), space = "Lab") #color
> image.plot(x,y,z, legend.lab="inches",col=whiteblack(30), breaks=seq(0,30,1))   #image.plot with breaks from 0 to 30
>
> x<- 1:10; y<- 1:15; z<- outer( x,y+5,"+")
> whiteblack = colorRampPalette(c("white", "black"), space = "Lab")
> image.plot(x,y,z, legend.lab="inches",col=whiteblack(30), breaks=seq(0,30,1))
>
> Thanks a lot for your help
>
>
> Mike
>
>
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list