Skip to content

Commit

Permalink
Allow static min and max via cfg
Browse files Browse the repository at this point in the history
Sometimes auto-scale is just not what you want, you can now just say cfg['minimum'] = 0 and cfg['maximum'] = 100 and the scale stays fixed.
  • Loading branch information
snobu authored Oct 12, 2018
1 parent fe711d3 commit 81beeff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions asciichartpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

def plot(series, cfg={}):

minimum = min(series)
maximum = max(series)
minimum = cfg['minimum'] if 'minimum' in cfg else min(series)
maximum = cfg['maximum'] if 'maximum' in cfg else max(series)

interval = abs(float(maximum) - float(minimum))
offset = cfg['offset'] if 'offset' in cfg else 3
Expand Down

0 comments on commit 81beeff

Please sign in to comment.