jsbueno / terminedia

Python3 library for multimedia functions at the command terminal
GNU Lesser General Public License v3.0
100 stars 8 forks source link

`terminedia-plot` wrong axis position and selection #28

Closed vytas7 closed 2 years ago

vytas7 commented 2 years ago

It seems that terminedia-plot plots points at a wrong y coordinate.

For instance, terminedia-plot --func x yields: image From the graph, I'm getting an impression that f(0.01) ≈ 2, which is obviously not even remotely true for f(x) = x.

(One can also see a minor cosmetic issue, a data point seems to be missing on the graph.)

terminedia-plot --func x*x seems to provide a roughly correct data point for (0, 0), but the choice for y range seems to be quite odd: image

vytas7 commented 2 years ago

Hi, this is still a problem :slightly_smiling_face: (Not a problem in the sense I'm using terminedia for anything but fun, but still).

f(x) = x now works as expected. f(x) = x*x is now wrong instead, it looks like f(0) = -4 or smth for x*x.

jsbueno commented 2 years ago

Fixed by commit be4b0324

Turns out I've evolved this form a very simple script in the early days of the project - and I was inverting the y value to be plotted right were it is calculated - instead of keeping a sane internal y value for the points and just reversing in the right direction at plot time.