Hide all elements of an axis
Show older comments
I have two axes objects in a figure and I'd like to switch back and forth between them by hiding the appropriate object. There is a figure.plots(i) variable which stores the axes handles. When I try using
toHide = allchild(figure.plots(i));
set(toHide,'visible','off');
set(figure.plots(i),'visible','off');
the axis legend of the plot I'm trying to hide stays visible. Is there a way for me to switch the legend off without shifting focus of the axes using axes(h)? I'm trying to expand this to a GUI which can handle many axes and I know the axes(h) command can be slow.
1 Comment
No time to 'spearmint at the moment, but I suspect your problem is that the subject handle isn't being returned by allchild. Likely you could find it by use of findall
ADDENDUM What component, specifically, is meant by "the axis legend"? I was thinking above of a legend object...but not sure sure on rereading.
If not solved the problem as yet, as almost always the case, providing enough of a sample case that illustrates the problem so folks can reproduce the symptoms will help immeasurably instead of just trying to describe them.
Accepted Answer
More Answers (0)
Categories
Find more on Creating, Deleting, and Querying Graphics Objects 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!