changeset 11199:91c606a68693

minor fix to previous changeset
author David Bateman <dbateman@free.fr>
date Sun, 07 Nov 2010 22:48:50 +0100
parents 9f080d23396f
children abc0c6b0a4c4
files scripts/plot/legend.m
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/legend.m	Sun Nov 07 22:35:40 2010 +0100
+++ b/scripts/plot/legend.m	Sun Nov 07 22:48:50 2010 +0100
@@ -109,11 +109,13 @@
     ca = get (fig, "currentaxes");
   endif
 
-  plty = get(ca (strcmp (get (ca, "tag"), "plotyy")), "userdata");
-  if (isscalar (plty))
-    ca = [ca, plty];
-  else 
-    ca = [ca, plty{:}];
+  if (strcmp (get (ca, "tag"), "plotyy"))
+    plty = get(ca (strcmp (get (ca, "tag"), "plotyy")), "userdata");
+    if (isscalar (plty))
+      ca = [ca, plty];
+    else 
+      ca = [ca, plty{:}];
+    endif
   endif
 
   if (all (ishandle (varargin{1})))