kivy-garden / graph

Displays plots on a graph.
MIT License
50 stars 18 forks source link

graph does not mask points outside of min and max #7

Open mdford opened 8 years ago

mdford commented 8 years ago

Perhaps I am using the graph incorrectly, but if I have points before xmin or after xmax, the graph still draws the line off the graph in those directions. I assumed (perhaps incorrectly) that the line would start at xmin and only go to xmax regardless of the contents of the plot array (hence the ability to set those values).

It might be better to explain my use case. I am collecting temperature readings and saving each reading to the plots. I start off displaying the graph from 0 to initially 600 seconds. The user has the ability to zoom the graph in and out and move it forwards and back to display a range of these readings. So, for example, if the current 'window' is 1200 to 1800, and xmin=1200 and xmax=1800 I would expect the line to only show the values in that range. However, the line extends to the left (pre 1200) and to the right (> 1800) to the limits of the container it is in.

Am I missing a setting or something? Or do I have to go and get a range of values all the time from my readings to match the current xmin and xmax. If so, that seems counter-intuitive and different from the way most graphs work.

Regardless, I appreciate this module and all the work that went into it - just need this clarified.

Thanks! Mark