#1049: optional histogram sidebar for legends
------------------------------+---------------------------------------------
Reporter: hamish | Owner: grass-dev@lists.osgeo.org
Type: enhancement | Status: new
Priority: minor | Milestone: 7.0.0
Component: Display | Version: svn-trunk
Keywords: d.legend, ps.map | Platform: All
Cpu: All |
------------------------------+---------------------------------------------
Hi,
I notice that VisIt has a neat feature to its color legends that let you
incorporate a cumulative | frequency distribution graph along side the
main color-gradient. It would be neat if d.legend & ps.map had that sort
of capability.
#1049: optional histogram sidebar for legends
------------------------------+---------------------------------------------
Reporter: hamish | Owner: grass-dev@…
Type: enhancement | Status: new
Priority: minor | Milestone: 7.0.0
Component: Display | Version: svn-trunk
Keywords: d.legend, ps.map | Platform: All
Cpu: All |
------------------------------+---------------------------------------------
Comment(by hamish):
it shouldn't be too hard:
look at how many pixels tall the FP legend is drawn on the display, then
get freq. data from 'r.stats nsteps=', so one value per screen line, scale
max width to equal the width of the legend box, then draw a series of
color= horizontal lines on the display connected to the left size of the
legend (other side from the text). -f is already used so I guess -d for
'distribution'.
Is there any demand for cumulative? or is histogram enough?
shown is a horizontal legend for elevation.10m from Spearfish drawn with a
histogram (-d flag), flipped left-right (-f flag, but setting at= as
max,min has the same effect [wxGUI currently seems to be sorting at=, so
that isn't working from the mouse]), and since I set the data units= with
r.support the legend now displays "meters" too without needing a separate
call to d.text.
the color rules there are a new addition as well, "roygbiv". In the
screenshot r.colors was run with the -e flag so the color scaling is set
to equal areas under the histogram curve instead of a linear color
transition from min to max.
note there's a rendering bug in D_box_abs() + the PNG driver wrt subpixel
rounding or closing-strokes. (run xmag on the right end of the legend in
the screenshot)