Skip to content
Snippets Groups Projects
Commit 19904da4 authored by Olivier Sauter's avatar Olivier Sauter
Browse files

fix legend to add on to linehandles if multiple shots

parent 77a983e1
No related branches found
No related tags found
1 merge request!153Add multi shot
......@@ -40,10 +40,12 @@ if doplot==0; return; end
redo_legend_from_Tags = 0;
do_legend = 1;
nb_linehandles_current = numel(linehandles);
for ishot=1:numel(gdat_data)
nb_linehandles_prev = nb_linehandles_current;
if all(isfield(gdat_data(ishot),{'data','t'})) && ~isempty(gdat_data(ishot).data) && ~isempty(gdat_data(ishot).t)
fighandle = get(0,'CurrentFigure');
if numel(gdat_data) > 1 && gdat_data(1).gdat_params.doplot==1
if ishot > 1 && gdat_data(1).gdat_params.doplot==1
% assume that for a series of shot, need doplot=-1 after 1st plot if doplot was 1 in request
doplot = -1;
end
......@@ -161,12 +163,13 @@ for ishot=1:numel(gdat_data)
zoom on;
end
maxnblines = 1;
nb_linehandles_current = numel(linehandles);
if ~exist('ab','var'), ab=get(gca,'children'); end
if do_legend==0 || redo_legend_from_Tags || any(strcmp(gdat_data(ishot).gdat_params.data_request,'powers')) ...
|| (numel(ab)==numel(gdat_data(ishot).label) && numel(ab)>1)
% keep legend as is
else
for i=1:numel(linehandles)
for i=nb_linehandles_prev+1:nb_linehandles_current
maxnblines = max(maxnblines,numel(linehandles{i}));
if numel(linehandles{i}) == 1
set(linehandles{i},'DisplayName',[num2str(gdat_data(ishot).shot)]);
......
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