How to add 3 x-axies onto a double subplot?
Show older comments
Hi,
I'm trying to create a subplot with two graph one under eachother; however, I want each to have 3 x-axies.
I'm doing some basic aircraft tail modeling and on the x-axies I want to have:
- the span (b) in meters
- the Aspect Ratio (AR) for sailplane
- the AR for twin engine
For a horizontal and vertical tail hence the subplot.
I have an array for the span a 1x500 array in meters.
To convert to the AR I need to use the formula:
Where there are two different areas, denoted as S. In matlab S_VT 2x1 array (sailplane and twin engine) and S_HT 2x1 array (sailplane and twin engine) .
Currently I have a plot like:

My current code:
b = linspace(1,5,500);
c_rVT = 2.*S_VT./(b.*(1+taper(1)));
c_rHT = 2.*S_HT./(b.*(1+taper(2)));
c_tVT = taper(1).*c_rVT;
c_tHT = taper(2).*c_rHT;
% plotting
figure(2);
subplot(2,1,1);
ax1 = axes('Position', [.1 .1 .8 1e-12]);
ax2 = axes('Position',[.1 .2 .8 .7]);
set(ax1,'Units','normalized');
set(ax2,'Units','normalized');
stem(ax2, b.^2./S_VT(1), c_rVT(1,:));
set(ax1,'xlim',[b(1)^2/S_VT(1) b(end)^2/S_VT(1)]);
plot(b,c_rVT(1,:),'-b', b,c_rVT(2,:),'-r',...
b,c_tVT(1,:),'--b', b,c_tVT(2,:),'--r');
title("Vertical tail platform sizing");
xlabel(ax2,"b in m"); xlabel(ax1, "AR");
ylabel(ax1,"chords in m");
legend("root chord (sailplane)", "root chord (twin engin)",...
"tip chord (sailplane)", "tip chord (twin engin)");
How can I add another x axies (and idealy put both the AR axies at the top of each plot) on both subplotts?
Thank you in advanced.
Accepted Answer
More Answers (0)
Categories
Find more on Axes Appearance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

