[R] setting labels on axis

Duncan Murdoch murdoch at stats.uwo.ca
Tue Nov 8 15:01:21 CET 2005


On 11/8/2005 8:35 AM, Andreas Lehnert wrote:
> Dear R,
> 
> When I try to plot e.g.
> 
> a<-matrix(1:100,10,10)
> image.plot(a,xlim=c(0,100),ylim=c(0,100))
> 
> I get the axis but without filling.
> I tried a few things, but it only works if I delete the 
> xlim and ylim. Then I have the range from 0:1.
> 
> Can anyone help me get the right labeling?

You need to tell us where you found that function.  Is it from the 
fields package?  If so, it treats its arguments the way the image() 
function does (from the graphics package), i.e. if you only supply a 
matrix, it assumes the axes run from 0 to 1.

If you want the axes to run from 0 to 100, then you call it as

image.plot(x=(0:10)*10, y=(0:10)*10, z=a)

Duncan Murdoch




More information about the R-help mailing list