yhur / arduplot

MIT License
41 stars 7 forks source link

Y-Axis #8

Closed markdegrootnl closed 2 years ago

markdegrootnl commented 2 years ago

Is it possible to set the Y-Axis scale? Would be nice.

yhur commented 2 years ago

I haven’t thought about that.

What would be the usage scenario?

markdegrootnl commented 2 years ago

For instance, say I'm logging a temperature sensor: Schermafbeelding 2022-03-10 om 12 35 32 Everything happens on the top of the screen.

Now if I change https://github.com/yhur/arduplot/blob/764e67a893401835fd53c481c18336e966a339fc/src/arduplot/plotserialdata.py#L100 to plt.axis([0, width, 23, 26]) it becomes a lot more useful:

Schermafbeelding 2022-03-10 om 12 38 55

Obviously the min and max values would have to be configurable using command line options, just like the width parameter.

yhur commented 2 years ago

I got you. I just updated the tool, and uploaded to pypi.org as well. Please take a look and give me your thought.

One drawback on this ymin/ymax is that it doesn't automatically scale for the peek or the fall beyond the setting.

markdegrootnl commented 2 years ago

Awesome!

The added benefit is that if you don't supply ymin and ymax, it autoscales even nicer then it did before.

yhur commented 2 years ago

Yes, I changed the default ymin to None as well in this version. Thank you for the suggestion.