legends....

Cliff Behrens cliff at bellcore.com
Tue May 11 09:54:46 EDT 1993


Christine,

As I recall, the default use of p.map.new uses whatever color table is 
defined for your raster layer...all you need to do is define patterns for
map categories.  I have listed below a script which shows you how to define
patterns for a p.map.  (I have one for each category of land use in my 
classified satellite image.)  Just remember to use p.map.new in 4.1 else you
won't see the legend on the screen.
============================================================================

raster lower.reclass.n3
colortable n

outline
  color black
  end
 
defpat solid
1
  color 1 black
  end

defpat empty
0
  color 0 white
  end

setpat builtin
setpat 0 empty 
setpat 1 #5
setpat 2 #1
setpat 3 #4
setpat 4 solid 
setpat 5 #3
setpat 6 empty

legend 64% 31% 
   height 15 
   width  15 
   xspace 15
   yspace 10
   textcolor black
   textsize  15
   textwidth  1 
   background  white
   border      black
   beginrast
      catnum  1  Cropland
      catnum  2  Pasture
      catnum  3  Forest Land
      catnum  4  Water
      catnum  5  Wetland
      catnum  6  Barren Land 
      end
   end 
end



More information about the grass-user mailing list