olavolav / uniplot

Lightweight plotting to the terminal. 4x resolution via Unicode.
MIT License
370 stars 16 forks source link

Extra lines are drawn that shouldn't be there #2

Closed olavolav closed 4 years ago

olavolav commented 4 years ago

To Reproduce:

>>> plot(xs=[1,1], ys=[0,1], lines=True, x_min=3, x_max=6)
┌────────────────────────────────────────────────────────────┐
│                    ▖                                       │ 1.0
│                    ▌                                       │ 
│                    ▌                                       │ 
│                    ▌                                       │ 
│                    ▌                                       │ 0.7
│                    ▌                                       │ 
│                    ▌                                       │ 
│                    ▌                                       │ 
│                    ▌                                       │ 0.5
│                    ▌                                       │ 
│                    ▌                                       │ 
│                    ▌                                       │ 
│                    ▌                                       │ 0.3
│                    ▌                                       │ 
│                    ▌                                       │ 
│                    ▌                                       │ 
│▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▌▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁│ 0.0
└────────────────────────────────────────────────────────────┘
 3                                                          6

Obviously there should not be anything drawn in this view.

Here, the correct line is drawn, but also weird other ones. In interactive mode this line appears once the real one is out of view.