Plot: Create GetDataLimits() for returning X/Y limits of all plotted data
See original GitHub issueScottPlot Version: 4.1.26
Operating System: W10
Application Type: WinForms
Question: I need to limit zoom out. I would like that it doesn’t go beyond the AxisAuto(). I know I can implement on application side something to compute Min/Max of existing data and use SetOuterViewLimits
to achieve this. However, I am wondering, wouldn’t be easier and more suited to have this functionality build in into Scottplot?
It could be a flag that we can set to limit zoom out to maximum the AxisAuto() fit.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
How to get the limits of plotted data from a Figure or Axes ...
First, just as a side note, from the fact that you want the data at point in the code where you only have...
Read more >Specify Axis Limits - MATLAB & Simulink
Specify the axis limits using the xlim and ylim functions. For 3-D plots, use the zlim function. Pass the functions a two-element vector...
Read more >Data disappears from plot when setting axes limits?
I want to be able to set the axes limits on all three, however when I do the plots return with no data...
Read more >Set Axis Limits of Plot in R
In this example, we will be setting up the limits of the y-axis from -20 to 20 of the given plot of 10...
Read more >Matplotlib | Set the Axis Range | Scaler Topics
In this article, we will go over different ways to set the axis range of our plots. Setting the range of axes in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @EFeru, thanks for posting this issue! I agree the current strategy is a bit clunky, and I’d love to figure-out a way to improve it.
Calculating min/max of existing data is actually pretty costly performance wise, so I wouldn’t want to do it automatically before each render. Instead I think the way to go is to have the user perform this task (they know best when the data may change).
What do you think about code that did something like this?
Basically it’s a way to get the limits from
AxisAuto()
without actually resizing the window yet. What do you think about this potential solution?Oh, I see more recent conversation in #1532…
Restating the problem, adding a plottable with an infinite axis (e.g., axis lines which extend to infinity) results in unexpected behavior:
I’ll add a comment in #1532 regarding how to best fix this