Mercurial > hg > octave-lyh
diff scripts/plot/legend.m @ 6272:a1f3d3b7ee5c
[project @ 2007-02-06 02:09:48 by jwe]
author | jwe |
---|---|
date | Tue, 06 Feb 2007 02:09:48 +0000 |
parents | 44c91c5dfe1d |
children | a8dd70bacc1e |
line wrap: on
line diff
--- a/scripts/plot/legend.m +++ b/scripts/plot/legend.m @@ -138,8 +138,17 @@ endif endif - if (nargs > 0 && isempty (__plot_data__{cf}{mxi,myi})) - warning ("legend: plot data is empty; setting key labels has no effect"); + if (nargs > 0) + have_data = false; + for i = 1:nkids + if (strcmp (get (kids(k), "type"), "line")) + have_data = true; + break; + endif + endfor + if (! have_data) + warning ("legend: plot data is empty; setting key labels has no effect"); + endif endif for i = 1:nargs