[GRASS-dev] d.histogram: x axis ticks labels fixed

hi,

the x axis ticks in d.histogram are often completey messed
up, especially for FP maps with range 0..1.0

I have hacked display/d.histogram/bar.c
-> line 116 etc
to get readable output for most FP maps (before there wasn't).

I have also added a fix (line 321) to enable FP number output for
small range maps, e.g. (NC OSGeo data set):

d.histogram soils_Kfactor

You can quickly test this with (Spearfish, NC, whatever):

# hit return for next map:
for i in `g.mlist rast` ; do d.histogram $i ;read ans ; done

Markus

Markus Neteler wrote:

the x axis ticks in d.histogram are often completey messed
up, especially for FP maps with range 0..1.0

bug report for this:
  http://intevation.de/rt/webrt?serial_num=1977
(note Paul had posted a patch there some months ago)

I have hacked display/d.histogram/bar.c
-> line 116 etc
to get readable output for most FP maps (before there wasn't).

I've done a quick test and it looks good. nice!
Resizing the xmon window recalculates the tick placement, if you want
to do a lot of testing quickly.

I have also added a fix (line 321) to enable FP number output for
small range maps, e.g. (NC OSGeo data set):

If I convert elevation.dem to a 0.0-1.0 FP map, the x axis tick labels
are all still "0". :frowning:

#spearfish
r.mapcalc elev.norm="(elevation.dem - 1066.) / (1840-1066.)"
d.histogram elev.norm

Before we spend too much more time on this module, were there plans to
reimplement the module as a wxPython program using one of the python
plotting libs?

'd.histogram -q' seems to be broken. (was a quiet flag removed from
r.stats?)

cheers,
Hamish

      ____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs

On 27/01/08 10:00, Hamish wrote:

Before we spend too much more time on this module, were there plans to
reimplement the module as a wxPython program using one of the python
plotting libs?

ISTR that we had this debate before, but I would plead for some basic graphing functionality to remain available outside of the GUI. Now since we have decided that python is going to be the scripting language in the future, it is probably reasonable to require it as dependency, but please make sure that you can also get the results of d.histogram into a ps/png file at the command line.

Moritz