#124: d.legend: apply arbitrary labels to a smooth floating-point colorbar
--------------------------------+-------------------------------------------
Reporter: epatton | Owner: grass-dev@lists.osgeo.org
Type: enhancement | Status: new
Priority: minor | Milestone: 6.4.0
Component: default | Version: svn-trunk
Keywords: colorbar, d.legend |
--------------------------------+-------------------------------------------
In d.legend, one is able to request arbitrary cat values for labelling
with the use= parameter, but doing so creates blocks around each cat value
requested in the output color bar. I would like to request the ability to
arbitrarily label values on a *smoothed* color bar for a floating-point
raster. d.legend makes nice color bars for floating point
elevation/bathymetry rasters, I would just like it to label whatever set
of values I give it, while maintaining the nice, smooth color bar over the
entire range of raster values.
Ok, for instance, see legend1.png; it shows a color bar divided into 6
intervals on a floating-point bathymetry dataset; I don't want to use odd
depth values like -188 and -92; I would prefer to label -200, -150, -100,
etc. When I use the use= paramter, the legend gets chopped into squares,
ruining the nice, continous color bar (legend2.png; also, the labels
become huge for some reason).
So basically, I would ideally like a color bar like legend1.png, but with
arbitrary labels applied.
Using the range= and labelnum= options you should be able to get the look
you are after.
{{{
d.legend range=0,-200
}}}
then you get labelnum=5 ticks at: 0,-50,-100,-150,-200
* adjust your color rules so that they cover the full range
* with the range= option do max,min instead of min,max to flip the legend
vertically (or use the -f flag)
see also ps.map's colorbar legends. They work the other way and try to
fall on round numbers automatically. Both ways have their merits, but I
guess I hear less complaints about the ps.map way. (but less people use
that, so who knows)
Ok, great! This is what I was looking for. Sorry for the noise; I
misinterpreted what labelnum= was used for, and so never tried it in
combination with range=. For most cases I should be able to play with
labelnum to get the right divisor into the raster range.