Ver código fonte

d.histogram: fix x axis labels for small numbers, see https://trac.osgeo.org/grass/ticket/2463 (merge from trunk, https://trac.osgeo.org/grass/changeset/68953)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@69196 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 8 anos atrás
pai
commit
3c25c47df6
1 arquivos alterados com 2 adições e 1 exclusões
  1. 2 1
      display/d.histogram/bar.c

+ 2 - 1
display/d.histogram/bar.c

@@ -307,7 +307,8 @@ int bar(struct stat_list *dist_stats,	/* list of distribution statistics */
 	    if (nodata && i == dist_stats->mincat)
 		sprintf(txt, "null");
 	    else if (is_fp) {
-		if ((range_dmax - range_dmin) <= 1.0)
+		dmin = range_dmin + i * (range_dmax - range_dmin) / nsteps;
+		if ((tic_every * (range_dmax - range_dmin) / nsteps) < 1.0)
 		    sprintf(txt, "%.2f", dmin / (double)tic_unit);
 		else
 		    sprintf(txt, "%d", (int)(dmin / (double)tic_unit));