Skip to content
Snippets Groups Projects
Commit cb178083 authored by jacques.grelet_ird.fr's avatar jacques.grelet_ird.fr
Browse files

comment axes and use it as first parameter of line

line(hPlotAxes(i), ...
parent 481bd1d1
No related branches found
No related tags found
No related merge requests found
......@@ -70,33 +70,38 @@ for i = 1:2
continue
end
% for a valid parameter, plot climatology
% --------------------------------------
if para
meanc = zeros(size(dayd));
stdc = zeros(size(dayd));
% prepare the interpolation
% ---------------------------
latc = tsg.levitus.data.WOA_LATX;
lonc = tsg.levitus.data.WOA_LONX;
clim = tsg.levitus.data.(['WOA_MEAN_' para]);
% remove sigleton dimension
clim = squeeze(clim(time_dim,depth,:,:));
% interpolation for 2-D gridded
meanc = interp2(lonc,latc,clim,lon,lat);
% same for standard deviation
sclim = tsg.levitus.data.(['WOA_STD_' para]);
sclim = squeeze(sclim(time_dim,depth,:,:));
stdc = interp2(lonc,latc,sclim,lon,lat);
% Select the axes
% ---------------
axes( hPlotAxes(i) );
%axes( hPlotAxes(i) );
% Plot mean salinity climatology
% ------------------------------
line(dayd, meanc, ...
line(hPlotAxes(i), dayd, meanc, ...
'Tag', ['TAG_LINE_CLIMATO_MEAN_' para], 'Linestyle', '-', 'Color','k');
% Plot with 3 standard deviation
% ------------------------------
line(dayd, meanc + 3 * stdc, ...
line(hPlotAxes(i), dayd, meanc + 3 * stdc, ...
'Tag', ['TAG_LINE_CLIMATO_STDDEV_PLUS_' para], 'Linestyle', '-', 'Color','r');
line(dayd, meanc - 3 * stdc, ...
line(hPlotAxes(i), dayd, meanc - 3 * stdc, ...
'Tag', ['TAG_LINE_CLIMATO_STDDEV_MINUS_' para], 'Linestyle', '-', 'Color','r');
% Plot marker if climatological value has no neighbour
......@@ -104,11 +109,11 @@ for i = 1:2
indnon=find(isfinite([meanc',nan]) & isnan(circshift([meanc',nan],[0 1]))...
& isnan(circshift([meanc',nan],[0 -1])));
if ~isempty(indnon)
line(dayd(indnon), meanc(indnon), ...
line(hPlotAxes(i), dayd(indnon), meanc(indnon), ...
'Tag', ['TAG_LINE_CLIMATO_MEAN_' para], 'Linestyle', 'none', 'Color','k','Marker','d');
line(dayd(indnon), meanc(indnon) + 3 * stdc(indnon), ...
line(hPlotAxes(i), dayd(indnon), meanc(indnon) + 3 * stdc(indnon), ...
'Tag', ['TAG_LINE_CLIMATO_STDDEV_PLUS_' para], 'Linestyle', 'none', 'Color','r','Marker','d');
line(dayd(indnon), meanc(indnon) - 3 * stdc(indnon), ...
line(hPlotAxes(i), dayd(indnon), meanc(indnon) - 3 * stdc(indnon), ...
'Tag', ['TAG_LINE_CLIMATO_STDDEV_MINUS_' para], 'Linestyle', 'none', 'Color','r','Marker','d');
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment