diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-05-13 07:45:26 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-05-13 08:42:42 +0100 |
commit | 15788d264e9804a876c88167cb18ad506c7ede05 (patch) | |
tree | 266bfbb470412a197d7d5ee85553af82f11bfef2 | |
parent | c201cd58c24f5fe611b63cf1a71cc6953538fe96 (diff) |
better-bars
-rw-r--r-- | ministat.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -358,7 +358,7 @@ PlotSet(struct dataset *ds, int val) } i = -1; for (n = 0; n < ds->n; n++) { - x = (ds->points[n] - pl->x0) / pl->dx; + x = floor((ds->points[n] - pl->x0) / pl->dx); if (x == i) { j++; } else { @@ -368,17 +368,17 @@ PlotSet(struct dataset *ds, int val) pl->data[j * pl->width + x] |= val; } if (!isnan(Stddev(ds))) { - x = ((Avg(ds) - Stddev(ds)) - pl->x0) / pl->dx; - m = ((Avg(ds) + Stddev(ds)) - pl->x0) / pl->dx; + x = floor(((Avg(ds) - Stddev(ds)) - pl->x0) / pl->dx); + m = ceil(((Avg(ds) + Stddev(ds)) - pl->x0) / pl->dx); pl->bar[bar][m] = '|'; pl->bar[bar][x] = '|'; for (i = x + 1; i < m; i++) if (pl->bar[bar][i] == 0) pl->bar[bar][i] = '_'; } - x = (Median(ds) - pl->x0) / pl->dx; + x = floor((Median(ds) - pl->x0) / pl->dx); pl->bar[bar][x] = 'M'; - x = (Avg(ds) - pl->x0) / pl->dx; + x = floor((Avg(ds) - pl->x0) / pl->dx); pl->bar[bar][x] = 'A'; } |