Plot points on saved figures in tiled layouts
2 次查看(过去 30 天)
显示 更早的评论
I'm trying to create a plot with two figures of experimental data (loaded from .fig files) with my data scattered on the plots. The first plot works as expected (figure loads to tile and then points are correctly plotted over the figure, using the same axes as the loaded figure). When I try to plot onto the second figure/tile, new axes are created for my scattered points rather than using the axes from the loaded figure. How can I force my second scatter plot to use the same axis as the figure that is loaded to that tile?

%data from simulation
CD_12 = 0.073319041;
CL_12 = 0.44840455;
CD_5 = 0.017854421;
CL_5 = 0.4961008;
alpha = 12; %degrees
openfig('NACA0012_CD.fig'); %load saved figure
set(gcf,'Visible','off') %don't display figure on load
ax1=gca;
openfig('NACA0012_CL.fig');
set(gcf,'Visible','off')
ax2=gca;
figure()
hold on
tcl=tiledlayout(2,2); %create subplots
ax1.Parent=tcl;
ax1.Layout.Tile=1;
scatter(12, CD_12) %plot my data
hold on
scatter(5, CD_5)
nexttile
ax2.Parent=tcl;
ax2.Layout.Tile=2;
hold on
scatter(12, CL_12) %plot my data
hold on
scatter(5, CL_5)
0 个评论
采纳的回答
Adam Danz
2021-3-23
>How can I force my second scatter plot to use the same axis
Specify the axis handle in the scatter function,
scatter(ax2, __)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Axes Appearance 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!