[STATSGRASS] rast.put & colors

Roger Bivand Roger.Bivand at nhh.no
Fri Sep 13 13:43:44 EDT 2002


On Thu, 12 Sep 2002, Bodo Ahrens wrote:

> hallo helpers,
> 
> I try to use rast.put. I am able to put the raster file (floating precission 
> with NA values) into grass.
> 
> The problem is the color scheme: How can I define breaks and colors?
> 
> I tried variations of
> 
> rast.put(G,lname=paste("9",month.fname,day.fname,hour.fname,minute.fname,".",imgtype,sep=""), 
> layer=aust$rimage.3d, 
> title="2dRadarimage",breaks=c(-0.5,0.5,13.5),col=c("red","black"))
> 
> but grass always applies its default colors.
> 
> I am trying on 
> LINUX SUSE 8.0
> GRASS/R 0.1-11
> R 1.5.1
> GRASS 5.0.0pre5
> 
> What is the trick?

This is quite complicated - thanks for pointing out the difficulty. I'll 
be able to respond more fully after the weekend, because I'm at the Grass 
Users' meeting in Trento, which is great, and will lead to improvements in 
the interface.

I think you are getting caught in the conditions which are rather odd. If 
aust$rimage.3d is a numeric vector (what does is.numeric(aust$rimage.3d) 
say?) then I think you would get the behaviour you observe - I think you 
would need to make aust$rimage.3d a factor first with cut(), using the 
same breaks, then not give rast.put() the breaks. I certainly need to give 
examples of how this is meant to happen on the help page, but at a 
distance I'm not sure that this is the right explanation. Please let me 
know if this helps or not, and I'll certainly upgrade the help page.

Roger 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand at nhh.no
and: Department of Geography and Regional Development, University of
Gdansk, al. Mar. J. Pilsudskiego 46, PL-81 378 Gdynia, Poland.




More information about the grass-stats mailing list