How to plot a profile of temperature and potential density with depth.

4 views (last 30 days)
Hello, as part of my project I'm trying to plot multiple x variables (temp, salinity, pdensity etc.) on one y variable (depth). I'm new to matlab and haven't had much luck so far. I can get all my data looking good using subplot however it would save space and look more effective to have multiple variables on one graph.
An additional problem is because I am not defining the axis myself I am using someone elses data with predefined axis to make these graphs.
thanks in advance.
subplot(1,4,1)
plot(chl,z,'g')
axis([0 1.5 -100 0])
xlabel({'Chlorophyll concn.','(mg m^{-3})'},'fontsize',14)
ylabel('z (m)','fontsize',14)
set(gca,'FontSize',12)
set(findall(gca, 'Type', 'Line'),'LineWidth',3.5);
subplot(1,4,2)
plot(NO3,z,'b')
axis([0 8 -100 0])
xlabel({'Nitrate concn.','(mmol m^{-3})'},'fontsize',14)
ylabel('z (m)','fontsize',14)
set(gca,'FontSize',12)
set(findall(gca, 'Type', 'Line'),'LineWidth',3.5);
set(gca,'XTick',0:2:10);
subplot(1,4,3)
plot(temp,z,'r')
axis([9 15 -100 0])
xlabel({'Temperature','(\circC)'},'fontsize',14)
ylabel('z (m)','fontsize',14)
set(gca,'FontSize',12)
set(findall(gca, 'Type', 'Line'),'LineWidth',3.5);
subplot(1,4,4)
plot(pden,z,'k')
axis([1.0252e+03 1.0264e+03 -100 0])
xlabel({'Potential density','(\rho\theta)'},'fontsize',14)
ylabel('z (m)','fontsize',14)
set(gca,'FontSize',12)
set(findall(gca, 'Type', 'Line'),'LineWidth',3.5);
set(gca,'XTick',1025.2:0.6:1026.4);
end

Answers (0)

Categories

Find more on MATLAB 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!