set TileSpacing in reopened figure

2 Ansichten (letzte 30 Tage)
abu
abu am 25 Aug. 2021
Kommentiert: abu am 26 Aug. 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

Akzeptierte Antwort

Chunru
Chunru am 26 Aug. 2021
Bearbeitet: Chunru am 26 Aug. 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 Kommentar
abu
abu am 26 Aug. 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!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by