# HG changeset patch # User David Bateman # Date 1289166530 -3600 # Node ID 91c606a6869369119d5650bdd24c70850c369ebc # Parent 9f080d23396f7f7ce89cf273ed25f8ea924a6859 minor fix to previous changeset diff --git a/scripts/plot/legend.m b/scripts/plot/legend.m --- a/scripts/plot/legend.m +++ b/scripts/plot/legend.m @@ -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})))