How do you end a tiledlayout object

33 vues (au cours des 30 derniers jours)
jake zhao
jake zhao le 13 Déc 2020
Commenté : jake zhao le 13 Déc 2020
Im using a live script to generate multiple figures for a project and am using tiledlayout for some of the plots. Im running into the issue where after I call the function and use all the tiles, I am unable to generate normal plots again without explicitly generating a new tiledlayout object of size 1x1. Instead it will either overwrite the last plot of the tiledlayout or do some weird stuff. Is there anyway to stop the tiled layout?

Réponse acceptée

Cris LaPierre
Cris LaPierre le 13 Déc 2020
Use figure to create a new figure window for plotting the next plot.
Live scripts will continue to use the same figure for all plotting unless you explicitly create a new one. If you use section breaks, what you see in each section are snapshots of the same figure, rather than new figures (unless you've created it with figure).
tiledlayout(1,2);
[X,Y,Z] = peaks(20);
% Tile 1
nexttile
surf(X,Y,Z)
% Tile 2
nexttile
contour(X,Y,Z)
% New plot
figure
x=1:5;
y=x.^2;
plot(x,y)
  1 commentaire
jake zhao
jake zhao le 13 Déc 2020
perfect, thanks

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Axes Appearance dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by