[GRASSLIST:385] Re: Legends

David Finlayson dfinlays at u.washington.edu
Sat Jun 14 16:29:51 EDT 2003


When doing a comparison between a series of maps (say temperature) it is 
important that the color for a given temperature remain the same 
throughout the whole series no matter what the range of individual maps 
might be.  Is this possible?

David

Glynn Clements wrote:
> H Bowman wrote:
> 
> 
>>>* Now, the opposite problem:
>>> Is there a way to force GRASS to display a legend based on a given
>>> color table, even if some categories are missing ?
>>>For example, I have a FCELL map with values in the range 0-1000. The
>>>legend starts at the lowest category (say, 127) and ends at the
>>>largest (say, 851), when in fact, I expect a display from 0 to 1000.
>>>Here again, any work around ? (apart forcing one of the cells to 0,
>>>and another to 1000 ?) Could it be implemented for a next version ?
>>
>>d.legend takes the color from the map. If the color doesn't exist in the
>>map, d.legend can't know what to use. I think it is a bad idea to have
>>d.legend try and extrapolate a color value or read directly from the
>>colr file and re-implement existing library functions. I suppose it
>>might be feasible to extend the default range with the range= option
>>with whatever library function the raster map uses to find its color
>>value if you wanted, but I have no plans to do so and don't think the
>>official version should do this either.
> 
> 
> Note that there is a public mechanism for obtaining the extent of the
> colour table, i.e. G_get_d_color_range().
> 
> However, I'm not sure whether that is actually the right approach. 
> It's arguable that there should be some notion of the "total" range,
> distinct from the range of values which actually occur.
> 
> E.g. for intensity rasters (i.e. images), it would be useful to be
> able to determine that e.g. 255 corresponds to "100%".
> 

-- 
David Finlayson
School of Oceanography
Box 357940
University of Washington
Seattle, WA  98195-7940
USA

Office: Marine Sciences Building, Room 112
Phone: (206) 616-9407
Web: http://students.washington.edu/dfinlays




More information about the grass-user mailing list