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

correction d'un bug sur la prise en l'affichage du nom de la variable...

correction d'un bug sur la prise en l'affichage du nom de la variable selectionnée sur l'axe Y, meme quand la variable est vide.
Testé uniquement sur le plot 3, a généraliser par la suite si OK
parent b2d1fe37
No related branches found
No related tags found
No related merge requests found
function plot_Tsg( hTsgGUI, hAxes, PlotNum, X, Y, QC, para, colVal, ... function plot_Tsg( hTsgGUI, hAxes, PlotNum, X, Y, QC, para, colVal, ...
lineType, markType, markSize ) lineType, markType, markSize )
% %
% Function to plot TSG parameters % Function to plot TSG parameters
% The program can plot parameter of style SSPS or SSPS_ADJUSTED % The program can plot parameter of style SSPS or SSPS_ADJUSTED
...@@ -15,7 +15,7 @@ function plot_Tsg( hTsgGUI, hAxes, PlotNum, X, Y, QC, para, colVal, ... ...@@ -15,7 +15,7 @@ function plot_Tsg( hTsgGUI, hAxes, PlotNum, X, Y, QC, para, colVal, ...
% QC ............. QC array - If empty plot using Color specification % QC ............. QC array - If empty plot using Color specification
% para % para
% colVal ..........[] - Draw Para taking into account color QC code % colVal ..........[] - Draw Para taking into account color QC code
% 'k''b'... - Draw Para using Color code % 'k''b'... - Draw Para using Color code
% lineType ....... Matlab type : 'none', '-', '--', ':', '-.' % lineType ....... Matlab type : 'none', '-', '--', ':', '-.'
% markType ....... Matlab type % markType ....... Matlab type
% markSize ....... Integer % markSize ....... Integer
...@@ -32,55 +32,55 @@ if ~isempty( X ) && ~isempty( Y ) ...@@ -32,55 +32,55 @@ if ~isempty( X ) && ~isempty( Y )
% get axes % get axes
% -------- % --------
axes( hAxes(PlotNum) ); axes( hAxes(PlotNum) );
% Plot using QC % Plot using QC
% ------------- % -------------
if ~isempty(QC) if ~isempty(QC)
% get list of keys from hashtable tsg.qc.hash, defined inside % get list of keys from hashtable tsg.qc.hash, defined inside
% tsg_initialisation.m % tsg_initialisation.m
% ----------------------------------------------------------- % -----------------------------------------------------------
qc_list = keys(tsg.qc.hash); qc_list = keys(tsg.qc.hash);
% Plot Sample/TSG differences on axe 2 % Plot Sample/TSG differences on axe 2
% iterate (loop) on each key store inside hastable % iterate (loop) on each key store inside hastable
% ------------------------------------------------ % ------------------------------------------------
for key = qc_list for key = qc_list
% get key and some values in hashtable % get key and some values in hashtable
% ------------------------------------ % ------------------------------------
qcState = tsg.qc.hash.(key).state; qcState = tsg.qc.hash.(key).state;
qcCode = tsg.qc.hash.(key).code; qcCode = tsg.qc.hash.(key).code;
qcColor = tsg.qc.hash.(key).color; qcColor = tsg.qc.hash.(key).color;
% qcState = get(tsg.qc.hash, key, 'state'); % qcState = get(tsg.qc.hash, key, 'state');
% qcCode = get(tsg.qc.hash, key, 'code'); % qcCode = get(tsg.qc.hash, key, 'code');
% qcState = get(tsg.qc.hash, key, 'color'); % qcState = get(tsg.qc.hash, key, 'color');
% plot tsg salinity sample with right code/color % plot tsg salinity sample with right code/color
% ---------------------------------------------- % ----------------------------------------------
ind = find( QC == qcCode ); ind = find( QC == qcCode );
if ~isempty( ind ) if ~isempty( ind )
line( X(ind), Y(ind), ... line( X(ind), Y(ind), ...
'Tag', ['TAG_PLOT' num2str(PlotNum) '_LINE_' para '_' char(key)],... 'Tag', ['TAG_PLOT' num2str(PlotNum) '_LINE_' para '_' char(key)],...
'LineStyle', lineType, ... 'LineStyle', lineType, ...
'Marker', markType, 'MarkerSize', markSize, 'Color', qcColor); 'Marker', markType, 'MarkerSize', markSize, 'Color', qcColor);
end end
end end
else else
line( X, Y, 'Tag', ['TAG_PLOT' num2str(PlotNum) '_LINE_' para], ... line( X, Y, 'Tag', ['TAG_PLOT' num2str(PlotNum) '_LINE_' para], ...
'LineStyle', lineType, ... 'LineStyle', lineType, ...
'Marker', markType, 'MarkerSize', markSize, 'Color', colVal); 'Marker', markType, 'MarkerSize', markSize, 'Color', colVal);
end end
% hold off; end
% Write some 'Y' label
% ------------------
set(get(hAxes(PlotNum), 'Ylabel'), 'Interpreter', 'none', 'String', para);
% Write some 'Y' label
% ------------------
set(get(hAxes(PlotNum), 'Ylabel'), 'Interpreter', 'none', 'String', para);
end
...@@ -83,10 +83,10 @@ switch nPlot ...@@ -83,10 +83,10 @@ switch nPlot
% --------------------------------------------------------------------- % ---------------------------------------------------------------------
case 3 case 3
erase_Line( hPlotAxes, 3 ); erase_Line( hPlotAxes, 3 );
if ~isempty( tsg.(PARA) ) % if ~isempty( tsg.(PARA) )
plot_Tsg( hMainFig, hPlotAxes, 3, tsg.DAYD, tsg.(PARA),[],... plot_Tsg( hMainFig, hPlotAxes, 3, tsg.DAYD, tsg.(PARA),[],...
PARA, 'k', lineType, '*', 2); PARA, 'k', lineType, '*', 2);
end % end
end end
axesCommonProp( hPlotAxes ); axesCommonProp( hPlotAxes );
......
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