"Manually" adjusting the position of tiles in a tiled layout using Property Inspector
91 次查看(过去 30 天)
显示 更早的评论
All:
Thank you for reading this. My goal is to adjust the position of tiles in a tiled layout to match a particular layout that I have in mind. Let's say I have the following:
f1 = @(x) x^2;
f2 = @(x) sin(x);
f3 = @(x) tan(x);
x1 = -100;
x2 = 100;
tiledlayout('flow');
nexttile
fplot(f1, [x1 x2]);
nexttile
fplot(f2, [x1 x2]);
nexttile
fplot(f3, [x1 x2])
After running this code (and getting a tiled figure), I then go to the Property Inspector. I see the following:
I then go to the first Axes (or any of tha axes) and see the following:
However, I can't change any of the position parameters.
What should I do? Additionally, is there a "better" way of customizing the tile positions in a tiled layout?
Thank you.
0 个评论
回答(1 个)
Chris
2022-11-16
编辑:Chris
2022-11-16
figure('Color',[.8,.8,.8]) % The default figure color I see is white, which can be confusing
tiledlayout(2,4)
nexttile
nexttile(3,[2,2]) % Skip a tile, start on 3
nexttile([1,2]) % Next available, 2 tiles wide
Setting "flow" gives Matlab the go-ahead to reposition things as necessary, so that's definitely not what you want.
If you want complete control, just place the axes directly.
f = figure('Color',[.8,.8,.8]);
ax1 = axes(f,'Units','Normalized','Position',[0.1 0.1 0.3 0.3]);
ax2 = axes(f,'Units','Normalized','Position',[0.7 0.7 0.2 0.2]);
You can view the properties of each graphics object programmatically, without needing Property inspector.
ax1
plot(ax1,1:10)
There are many properties, of which "Position" is present for figures and axes.
ln = ax1.Children
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Specifying Target for Graphics Output 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!