Opened 16 years ago
Closed 6 years ago
#256 closed enhancement (fixed)
r.colors user settable min=, max=
Reported by: | wegmann | Owned by: | |
---|---|---|---|
Priority: | trivial | Milestone: | 6.5.0 |
Component: | Raster | Version: | 6.3.0 |
Keywords: | r.colors colors range | Cc: | |
CPU: | Unspecified | Platform: | Linux |
Description
I had the problem that I wanted to display 5 related raster which have different range of values (e.g. raster1: 0-10; raster2: 5-15; raster3: 6-17 etc.) with the same legend (bgyr) so that raster1 is mainly colored in blue, while raster3 has more green/yellow colors and so on.
I managed it with a script and it is also possible by defining the color rules by hand but adding a flag and add all related raster to a r.colors command would be very handy:
r.colors map=raster1 raster=raster1,raster2,raster3 col=bgyr -newflag
-newflag would scale the colors of raster1 to the range of colors provided by the values of all rasters. Perhaps it is also possible to add 'g.mlist ...' like in r.series for this feature.
Martin
Change History (7)
comment:1 by , 16 years ago
Component: | default → Raster |
---|
comment:2 by , 16 years ago
Replying to wegmann:
but adding a flag and add all related raster to a r.colors command would be very handy:
r.colors map=raster1 raster=raster1,raster2,raster3 col=bgyr -newflag
-newflag would scale the colors of raster1 to the range of colors provided by the values of all rasters.
If you're only interested in the range, adding minimum= and maximum= options would be a better approach.
follow-up: 4 comment:3 by , 16 years ago
yes that's right, just defining the range would be fine.
BTW is it possible to extract automatically the min/max values of a range of rasters with another module (like r.univar)? So that the user knows the range.
comment:4 by , 16 years ago
Replying to wegmann:
BTW is it possible to extract automatically the min/max values of a range of rasters with another module (like r.univar)? So that the user knows the range.
You can do it for a single map with "r.info -r". For multiple maps, you could use e.g.:
eval `for map in $maps ; do r.info -r $map ; done | sed 's/^.*=//' | sort -n | sed -n -e '1s/^/min=/p;$s/^/max=/p'`
comment:5 by , 16 years ago
Milestone: | 6.4.0 → 6.5.0 |
---|---|
Summary: | r.colors enhancement → r.colors user settable min=, max= |
comment:6 by , 6 years ago
The OP issue is solved in G7:r.colors which look at all the ranges. If really needed, range can be limited by custom color table. Closing.
comment:7 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
the "official" method for this would be something like:
or create a dummy map containing the full range and use color=bgyr.
then show full range in legend with:
ok, so not at all optimal.
Just on a pedantic note, I would point out that bcyr is superior to bgyr as it follows a more linear transition through the color cube. ;)
Hamish