From 5cdb2095a6784ec38870843fe94033c73f812040 Mon Sep 17 00:00:00 2001
From: Olivier Sauter <olivier.sauter@epfl.ch>
Date: Wed, 5 Mar 2014 16:11:34 +0000
Subject: [PATCH] add Tag only if doplot

git-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@4267 d63d8f72-b253-0410-a779-e742ad2e26cf
---
 crpptbx/gdat.m | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/crpptbx/gdat.m b/crpptbx/gdat.m
index b900d8b8..9e508598 100644
--- a/crpptbx/gdat.m
+++ b/crpptbx/gdat.m
@@ -187,7 +187,9 @@ try
 catch
 end
 
-h2=findobj(gca,'-regexp','Tag','gdat:*');
-if ~isempty(h2);
-  legend(get(sort(h2),'Tag'));
+if doplot~=0
+  h2=findobj(gca,'-regexp','Tag','gdat:*');
+  if ~isempty(h2);
+    legend(get(sort(h2),'Tag'));
+  end
 end
-- 
GitLab