1 |
% CTDplotY plot CTD parameters vs depth |
---|
2 |
% ========================================================================= |
---|
3 |
% CTDplotY Version 1.0 18-May-1999 |
---|
4 |
% |
---|
5 |
% Usage: |
---|
6 |
% CTDplotY |
---|
7 |
% |
---|
8 |
% Description: |
---|
9 |
% This Matlab script plots temperature, salinity, and density versus depth |
---|
10 |
% on the same figure by having floating y-axes beside the plot. |
---|
11 |
% |
---|
12 |
% Input: |
---|
13 |
% n/a |
---|
14 |
% |
---|
15 |
% Output: |
---|
16 |
% n/a |
---|
17 |
% |
---|
18 |
% Called by: |
---|
19 |
% n/a |
---|
20 |
% |
---|
21 |
% Calls: |
---|
22 |
% floatAxisY.m |
---|
23 |
% |
---|
24 |
% Author: |
---|
25 |
% Blair Greenan |
---|
26 |
% Bedford Institute of Oceanography |
---|
27 |
% 18-May-1999 |
---|
28 |
% Matlab 5.2.1 |
---|
29 |
% greenanb@mar.dfo-mpo.gc.ca |
---|
30 |
% ========================================================================= |
---|
31 |
% |
---|
32 |
|
---|
33 |
load ctd_stn72.mat |
---|
34 |
figure; |
---|
35 |
% plot temperature vs pressure |
---|
36 |
hl1=plot(pres,temp,'b-'); |
---|
37 |
% assign current axis handle to variable for later reference if needed |
---|
38 |
ax1=gca; |
---|
39 |
% set properties of the axes |
---|
40 |
set(ax1,'YMinorTick','on', 'box','on','ycolor',get(hl1,'color')) |
---|
41 |
% add title to plot |
---|
42 |
htitle = title(['Parizeau 96012 CTD Station ', num2str(Station(1)),' ', datestr(now)]); |
---|
43 |
ylabel('Temperature (solid)') |
---|
44 |
xlabel('Depth (m)') |
---|
45 |
|
---|
46 |
% add 1st floating axis for the second parameter (salinity) plotted |
---|
47 |
[hl2,ax2,ax3] = floatAxisY(pres,psal,'r:','Salinity (dotted)',[0 100 32 34]); |
---|
48 |
|
---|
49 |
|
---|
50 |
% add 2nd floating axis for the third parameter (density) plotted |
---|
51 |
[hl3,ax4,ax5] = floatAxisY(pres,sigp,'k--','Density (dashed)'); |
---|