[GRASS-SVN] r29830 - grass/trunk/display/d.histogram

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jan 25 08:06:57 EST 2008


Author: neteler
Date: 2008-01-25 08:06:57 -0500 (Fri, 25 Jan 2008)
New Revision: 29830

Modified:
   grass/trunk/display/d.histogram/bar.c
Log:
hack to get readable x-axis ticks. Still failing for FP maps with range 0..1.0

Modified: grass/trunk/display/d.histogram/bar.c
===================================================================
--- grass/trunk/display/d.histogram/bar.c	2008-01-25 10:33:11 UTC (rev 29829)
+++ grass/trunk/display/d.histogram/bar.c	2008-01-25 13:06:57 UTC (rev 29830)
@@ -112,7 +112,10 @@
 		   if(G_is_d_null_value(&range_dmin) || G_is_d_null_value(&range_dmax))
 		        G_fatal_error("Floating point data range is empty");
 
-                   while((range_dmax - range_dmin)/tics[i].every > max_tics)
+		   G_debug(3,"range: %f",range_dmax - range_dmin);
+		   if ( (range_dmax - range_dmin) < 1.0) tics[i].every = 5;
+		   if ( (range_dmax - range_dmin) < 110) tics[i].every = 20; /* dirrty hack */
+		   while((range_dmax - range_dmin)/tics[i].every > max_tics)
 		       i++;
                 }
 		else
@@ -122,6 +125,7 @@
                 }
 		tic_every = tics[i].every;
 		tic_unit = tics[i].unit;
+		G_debug(3,"max_tics: %d, tic_every: %d, tic_unit: %d", max_tics, tic_every, tic_unit);
 		strcpy(tic_name,tics[i].name);
 	}
 	else



More information about the grass-commit mailing list