set TileSpacing in reopened figure

5 vues (au cours des 30 derniers jours)
abu
abu le 25 Août 2021
Commenté : abu le 26 Août 2021
Hello,
I have a bunch of old .fig without the sourcecode at hand :-( . They were created using
t = tiledlayout(3,1);
t.TileSpacing = 'none';
Now when I reopen the figures I can manually change the TileSpacing in the Property Inspector to 'tight' , however I was not able to find a command to change the property by command line / code. Any suggestion is greatly appreciated!
Thanks in advance,
Andi

Réponse acceptée

Chunru
Chunru le 26 Août 2021
Modifié(e) : Chunru le 26 Août 2021
t = tiledlayout(3,1);
t.TileSpacing = 'none';
nexttile;
plot(rand(10,1));
nexttile;
plot(rand(10,1));
nexttile;
plot(rand(10,1));
savefig(gcf, 'output.fig');
figure;
open('output.fig')
h=findobj(gcf, 'Type', 'tiledlayout');
h.TileSpacing = 'tight';
  1 commentaire
abu
abu le 26 Août 2021
Works like charme, thanks for the support :-)
I was fiddling with findobj before, however not looking for tiledlayout, but for TileSpacing or TiledChartLayout. It seems I am not clear about the differences between objects, properties, classes etc. Do you have a resource at hand that could help me better understanding those basics?
Thank you again!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by