Axes auto-zoom based on a given line
Show older comments
In an application, I plot one series of data and a number of vertical lines showing where certain "events" occur along the data plot. The vertical lines' y-values are [min(data), max(data)]. I constrain the plot to x-zoom for a scrolling effect.
The drawback to this setup is this: If there is a single spike anywhere in the data, the vertical lines extend to its peak (max(data)). Thus the plot's YLim range is now very large, so other data trends get "flattened out". The user has asked if the y-zoom can be set to "auto", so he can see these other data trends when he x-zooms in another area (so it doesn't include the spike). But alas, y-zoom(auto) has no effect, because the vertical event lines have a height equal to the full data range.
So my question is: Can y-zoom be set to rescale based on one data series in the plot, instead of all of them?
Thanks in advance.
Accepted Answer
More Answers (0)
Categories
Find more on Data Exploration in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!