Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
modify x-label printouts
trim x-labels to smallest non-zero decimal, and drop decimal place if
  the x-value is an integer
  • Loading branch information
Mackenzie
Mackenzie committed Apr 16, 2014
commit e8aa977963a06c6dd97ca140b453ffc54d4096a1
5 changes: 4 additions & 1 deletion bashplotlib/histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ def calc_bins(n, min_val, max_val, h=None, binwidth=None):
if binwidth is None:
binwidth = (max_val - min_val) / h
for b in drange(min_val, max_val, step=binwidth, include_stop=True):
yield b
if b.is_integer():
yield int(b)
else:
yield b

def read_numbers(numbers):
"read the input data in the most optimal way"
Expand Down