@@ -53,7 +53,7 @@ function plot_timeseries(Data, Mdata, variables, depth, basename, varargin)
5353% default depends on length of time shown:
5454% 'd' for up to 60 days, 'm' for up to 18 months,
5555% 'y' otherwise
56- % 'title',title : title for the plot (default: "Depth: .. db "); an
56+ % 'title',title : title for the plot (default: "Depth: .. dbar "); an
5757% empty string ('') suppresses the title
5858% 'var2',variable : if variable is not empty, profiles of this second
5959% variable will be plotted; if it is the same type as the
@@ -228,8 +228,8 @@ function plot_timeseries(Data, Mdata, variables, depth, basename, varargin)
228228 [mini , idx{f ,d }] = min(abs(Datai.(floats{f }).PRES(: ,1 ) - depth(d )));
229229 press{f ,d } = Datai.(floats{f }).PRES(idx{f ,d },1 );
230230 if mini > Settings .depth_tol
231- warning([' Closest depth level to requested %.1f db for ' , ...
232- ' float %s is %.1f db ' ], depth(d ), floats{f }, press{f ,d });
231+ warning([' Closest depth level to requested %.1f dbar for ' , ...
232+ ' float %s is %.1f dbar ' ], depth(d ), floats{f }, press{f ,d });
233233 end
234234 end
235235end
@@ -261,16 +261,34 @@ function plot_timeseries(Data, Mdata, variables, depth, basename, varargin)
261261 set(gca ,' ColorOrderIndex' ,1 );
262262 hold(gca , ' on' )
263263 end
264- plot(Datai.(floats{f }).TIME(1 ,: ), ...
264+ plt1 = plot(Datai.(floats{f }).TIME(1 ,: ), ...
265265 Datai.(floats{f }).(variables{v })(idx{f ,d },: ), ' LineWidth' , 2 );
266+ % good values between missing values will not be connected by
267+ % a line, so plot them individually as points as well
268+ if find(isnan(Datai.(floats{f }).(variables{v })(idx{f ,d },: )), 1 )
269+ color1 = get(plt1 , ' color' );
270+ sc1 = scatter(Datai.(floats{f }).TIME(1 ,: ), ...
271+ Datai.(floats{f }).(variables{v })(idx{f ,d },: ), 7 , ...
272+ color1 , ' filled' );
273+ set(get(get(sc1 , ' Annotation' ), ' LegendInformation' ), ...
274+ ' IconDisplayStyle' , ' off' );
275+ end
266276 [long_name , units ] = get_var_name_units(variables{v });
267277 ylabel([long_name , ' ' , units ])
268278 if ~isempty(var2_orig )
269279 if ~same_var_type
270280 yyaxis right ;
271281 end
272- plot(Datai.(floats{f }).TIME(1 ,: ), ...
282+ plt2 = plot(Datai.(floats{f }).TIME(1 ,: ), ...
273283 Datai.(floats{f }).(var2{v })(idx{f ,d },: ), ' LineWidth' , 2 );
284+ if find(isnan(Datai.(floats{f }).(var2{v })(idx{f ,d },: )), 1 )
285+ color2 = get(plt2 , ' color' );
286+ sc2 = scatter(Datai.(floats{f }).TIME(1 ,: ), ...
287+ Datai.(floats{f }).(var2{v })(idx{f ,d },: ), 7 , ...
288+ color2 , ' filled' );
289+ set(get(get(sc2 , ' Annotation' ), ' LegendInformation' ), ...
290+ ' IconDisplayStyle' , ' off' );
291+ end
274292 if ~same_var_type
275293 [long_name , units ] = get_var_name_units(var2_orig );
276294 ylabel([long_name , ' ' , units ])
@@ -285,10 +303,10 @@ function plot_timeseries(Data, Mdata, variables, depth, basename, varargin)
285303 if isempty(title1 ) && ~ischar(title1 ) % i.e., []
286304 if strcmp(lgnd , ' no' ) || ~isempty(var2_orig )
287305 % add float number to title instead
288- title(sprintf(' Depth: %d db (%s )%s ' , press{f ,d }, ...
306+ title(sprintf(' Depth: %d dbar (%s )%s ' , press{f ,d }, ...
289307 floats{f }, title_added{v }));
290308 else % legend shows float number
291- title(sprintf(' Depth: %d db %s ' , press{f ,d }, ...
309+ title(sprintf(' Depth: %d dbar %s ' , press{f ,d }, ...
292310 title_added{v }));
293311 end
294312 else
@@ -305,7 +323,7 @@ function plot_timeseries(Data, Mdata, variables, depth, basename, varargin)
305323 end
306324 end
307325 if ~isempty(basename )
308- fn_png = sprintf(' %s _%d _%s%s _%d db .png' , basename , ...
326+ fn_png = sprintf(' %s _%d _%s%s _%d dbar .png' , basename , ...
309327 Mdata.(float_ids{f }).WMO_NUMBER, variables{v }, ...
310328 var2_insert{v }, press{f ,d });
311329 print(f1 , ' -dpng' , fn_png );
@@ -319,10 +337,10 @@ function plot_timeseries(Data, Mdata, variables, depth, basename, varargin)
319337 end_date , time_label )
320338 if isempty(title1 ) && ~ischar(title1 ) % i.e., []
321339 if strcmp(lgnd , ' yes' )
322- title(sprintf(' Depth: %d db %s ' , press{f ,d }, ...
340+ title(sprintf(' Depth: %d dbar %s ' , press{f ,d }, ...
323341 title_added{v }));
324342 else
325- title(sprintf(' Depth: %d db (%s )%s ' , press{f ,d }, ...
343+ title(sprintf(' Depth: %d dbar (%s )%s ' , press{f ,d }, ...
326344 floats{f }, title_added{v }));
327345 end
328346 else
@@ -333,7 +351,7 @@ function plot_timeseries(Data, Mdata, variables, depth, basename, varargin)
333351 ' AutoUpdate' ,' off' );
334352 end
335353 if ~isempty(basename )
336- fn_png = sprintf(' %s _%s%s _%d db .png' , basename , variables{v }, ...
354+ fn_png = sprintf(' %s _%s%s _%d dbar .png' , basename , variables{v }, ...
337355 var2_insert{v }, press{f ,d });
338356 print(f1 , ' -dpng' , fn_png );
339357 end
0 commit comments