- Call gca with the figure handle so you know it's accessing the axes within the figure you just opened (assuming there is only 1 axes within the opened figure). ax1 = gca(h1);
- Might by a typo but ax3 is assigned to tile #2 in your demo code.
Create tiled layout with openfig
32 次查看(过去 30 天)
显示 更早的评论
I wish to create a tiled layout of figures (say 1x3) and each figure is loaded using openfig.
Currently i am using the following code to implement the same:
h1 = openfig('fig1.fig','reuse'); % open figure
ax1 = gca;
h2 = openfig('fig2.fig','reuse'); % open figure
ax2 = gca;
h3 = openfig('fig3.fig','reuse'); % open figure
ax3 = gca;
figure;
tcl=tiledlayout(1,3);
ax1.Parent=tcl;
ax1.Layout.Tile=1;
ax2.Parent=tcl;
ax2.Layout.Tile=2;
ax3.Parent=tcl;
ax3.Layout.Tile=2;
But this code doesn't work. While it opens all the three figures, only one figure is show on the tiled layout (as shown below)
Can someone point my mistake or point to a more efficient way of implementing this?
0 个评论
回答(1 个)
Adam Danz
2022-8-15
If you continue to have the problem, show us what tcl.Children looks like after setting all of the parents.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!