#3081 closed enhancement (fixed)
Add text after labels in d.legend
Reported by: | wenzeslaus | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 7.4.0 |
Component: | Display | Version: | unspecified |
Keywords: | d.legend, cartography | Cc: | |
CPU: | Unspecified | Platform: | Unspecified |
Description
Now G7:d.legend can show only the numbers for a given values and it looks like this:
| | 150 | | 100 | | 50 | | 0
I would like to attach a unit to each number, i.e. show the value and its units, something like this:
| | 150 m | | 100 m | | 50 m | | 0 m
The unit can/could be taken from raster map units (i.e. what G7:r.info gives) but I need to specify units manually because the unit is not always written in the metadata or it it not in the right form. Examples include degrees (deg, °) and percents (percentages, %).
The question is how to deal with the space between the number and the text (unit). Different languages (and fields) has different standards, so there should be probably a flag which would do it or the spaces would be just provided as part of the label (which might be less clear especially in the command line).
This applies just to continuous data but I don't see a reason to somehow disable this behavior for categorical legends.
Attachments (2)
Change History (8)
follow-up: 2 comment:1 by , 8 years ago
follow-up: 3 comment:2 by , 8 years ago
Type: | defect → enhancement |
---|
Replying to lazaa:
We could add option
units
which would display unit after every label
This is what I mean. units
sounds good.
or maybe just under the legend for all labels?
The feature of adding it there for all was already there (I'm not sure about the current situation). When the raster had units set (G7:r.info gives those), they would be show where the title currently is displayed. This still makes sense but it is more discussion about the title I think.
It seems to me more user friendly by default display units with whitespace after label and for cases of degrees or percentages add a new flag.
Agreed. Space by default might lead to better results in most cases. Flag for disabling solves the rest (when people need no space).
comment:3 by , 8 years ago
Replying to wenzeslaus:
Replying to lazaa:
We could add option
units
which would display unit after every labelThis is what I mean.
units
sounds good.or maybe just under the legend for all labels?
The feature of adding it there for all was already there (I'm not sure about the current situation). When the raster had units set (G7:r.info gives those), they would be show where the title currently is displayed. This still makes sense but it is more discussion about the title I think.
The feature is still there. Units are displayed under the legend if r.info gives those and no title is set (this should be probably changed so both units and title could be displayed at the same time if defined).
It seems to me more user friendly by default display units with whitespace after label and for cases of degrees or percentages add a new flag.
Agreed. Space by default might lead to better results in most cases. Flag for disabling solves the rest (when people need no space).
comment:4 by , 8 years ago
Added option units
and flag -w
to suppress whitespace between label and unit.
by , 8 years ago
Attachment: | d.leg.units.diff added |
---|
added option units
, without -w
flag. Side histogram fixed
We could add option
units
which would display unit after every label or maybe just under the legend for all labels? It seems to me more user friendly by default display units with whitespace after label and for cases of degrees or percentages add a new flag.