how to make subplot visible off along with the ploted line?
20 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
hello
I am using set(handle,'Visible','off') to make visibility of the subplot to off but its not working for the line which is already plot in the axes
0 commentaires
Réponses (1)
Geoff Hayes
le 23 Août 2014
Deepak - by calling set(handle,'Visible','off'), you are setting the visibility of the graphics object associated with handle to off and not its "children" which are the graphics drawn within the subplot axes. For example, if we were to draw the sine curve on two subplots as
x=-2*pi:0.0001:2*pi;
y=sin(x);
figure;
h1 = subplot(2,1,1);
plot(h1,x,y,'r');
h2 = subplot(2,1,2);
plot(h2,x,y,'b');
hold(h2,'on');
plot(h2,x,y+0.5,'g');
Now, like you, we try to hide the second subplot as
set(h2,'Visible','off');
and as you observed, the lines/plots drawn within the second subplot (the blue and green curves) are still visible. To set them invisible, like their parent subplot, we do
set(get(h2,'Children'),'Visible','off');
Now both the subplot and its children are invisible.
Try the above and see what happens!
0 commentaires
Voir également
Catégories
En savoir plus sur Subplots dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!