kroitor / asciichart

Nice-looking lightweight console ASCII line charts ╭┈╯ for NodeJS, browsers and terminal, no dependencies
MIT License
1.84k stars 94 forks source link

[Python] height off-by-one bug? #34

Closed hartwork closed 4 years ago

hartwork commented 4 years ago

This looks like an off-by-one bug for height — can you confirm?

In [9]: print(asciichartpy.plot([0, 0, 1, 2], {'height': 1}))
    2.00  ┼  ╭ 
    0.00  ┼──╯ 

In [10]: print(asciichartpy.plot([0, 0, 1, 2], {'height': 2}))
    2.00  ┼  ╭ 
    1.00  ┤ ╭╯ 
    0.00  ┼─╯  

In [11]: print(asciichartpy.plot([0, 0, 1, 2], {'height': 5}))
    2.00  ┼  ╭ 
    1.60  ┤  │ 
    1.20  ┤  │ 
    0.80  ┤ ╭╯ 
    0.40  ┤ │  
    0.00  ┼─╯  
kroitor commented 4 years ago

@hartwork yep, check this out:

I suggest to move this discussion there )