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