Rescaling axes when new point is plotted near current axis limits

2 views (last 30 days)
Hi, right now I have a bunch of points plotted. When I plot a new point that is close to the current axis limits but not outside of them, I need the axes to rescale so that the new point is not too close to the edge. How can I achieve this?
Thanks

Accepted Answer

Walter Roberson
Walter Roberson on 6 Apr 2011
There is no MATLAB command to get that to happen automatically.
The easiest way by far would be for you to create a routine that checked the items of interest to you and did the resizing, and call that routine after you have added what you want to add.
It would probably be possible to create listeners on every child object of an axes that has a position or which can have new children added or which can have its data altered to represent new positions, and have the listener go through the axes and re-determine whether the axes needs to be resized, but I think that would be very much a waste of effort.

More Answers (0)

Categories

Find more on Visual Exploration in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!