Skip to content

Commit a810d6c

Browse files
committed
Use center of bins as representation
1 parent 49e66b6 commit a810d6c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

imgs/hist.png

-1.27 KB
Loading

plotille.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ def _scale(a):
6464
for i in range(bins):
6565
hight = int(width * 8 * _scale(h[i]) / h_max)
6666
canvas += ['{:10.5f} | {:{width}s} {}'.format(
67-
b[i],
67+
(b[i] + b[i+1]) / 2, # use bucket center as representation
6868
'⣿' * (hight // 8) + lasts[hight % 8],
6969
h[i],
7070
width=width)]
71-
canvas += ['{:10.5f} | {}'.format(b[bins], '‾' * width)]
71+
canvas += ['‾' * (10 + 3 + width + 12)]
7272
return linesep.join(canvas)
7373

7474

0 commit comments

Comments
 (0)