[GRASS-dev] d.histogram problem [bug #1977]

Paul Kelly paul-grass at stjohnspoint.co.uk
Tue May 15 14:13:15 EDT 2007


On Tue, 15 May 2007, Hamish wrote:

> ok, so bug #1977 still matters. (axes tags somewhat broken for FP maps)
>  http://intevation.de/rt/webrt?serial_num=1977

I wonder is there a bit more too it that just the axes labelling. E.g. I 
tried comparing the output of "r.stats -c input=slope nsteps=10" to what 
d.histogram draws for nsteps=10. r.stats says:
0-5.252012 81333
5.252012-10.504024 86135
10.504024-15.756036 60593
15.756036-21.008047 37301
21.008047-26.260059 16918
26.260059-31.512071 6275
31.512071-36.764083 1415
36.764083-42.016095 139
42.016095-47.268107 13
47.268107-52.520119 1
* 12929

i.e. it seems obvious the first bar should cover the range 0-5.25012 and 
so on (although I think it's fine that the x-axis label shows whole 
numbers; it doesn't need to line up with the bar/bin edges), but in the 
d.histogram output it seems quite clear that the first bar is drawn 
between 5 and 10 (approximately) on the x-axis.

Also it seems strange that it doesn't allow you to set the number of bins 
for non-floating point maps.

Also, 255 bins seems not a very good default to me. It is a bit high and 
the result doesn't really look like a histogram.

I'll try and look into it more if I have time. Always remember doing maths 
at school and drawing a proper histogram being something that was really 
easy to get wrong!

Paul




More information about the grass-dev mailing list