Temperature with depth graph
1 view (last 30 days)
Show older comments
Hi everyone!
So I'm trying to plot a graph of temperature with depth at 4 stations with varied depths. The data that i have is in 4 different files and I'm trying to combine them all into 1 graph with temperature on the x axis and depth on the y axis but i need the y axis to start from the top and the x axis to be on the top as well.
I'v tried multiple times to do this but cant seem to work it out
Thanks in advance!!
0 Comments
Accepted Answer
KSSV
on 8 Nov 2016
[num,txt,raw] = xlsread('Temperature set.csv');
% num = flipud(num) ;
depth = num(:,1) ;
s1 = num(:,2) ;
s2 = num(:,3) ;
s3 = num(:,4) ;
s4 = num(:,5) ;
% plot
hold on
plot(s1,depth,'r') ;
plot(s2,depth,'b') ;
plot(s3,depth,'m') ;
plot(s4,depth,'c') ;
set(gca,'xaxisLocation','top')
set(gca,'YDir','reverse');
legend([{'station 1'};{'station 2'}; {'station 3'};{'station 4'}] )
0 Comments
More Answers (0)
See Also
Categories
Find more on Graph and Network Algorithms 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!