set TileSpacing in reopened figure

4 次查看(过去 30 天)
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

采纳的回答

Chunru
Chunru 2021-8-26
编辑:Chunru 2021-8-26
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 个评论
abu
abu 2021-8-26
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!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by