# HG changeset patch # User Ben Abbott # Date 1293576064 18000 # Node ID a451eb6f92b2bac3a50908203a0f734dddf6ce05 # Parent 466ba499eff5166595ddc6f02c23752aa80fcda8 __plt__.m: Fix to allow inline legend keys. Bug 31991. diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2010-12-28 Ben Abbott + + * plot/private/__plt__.m: Fix to allow inline legend keys. Bug 31991. + 2010-12-28 Rik * image/autumn.m, image/bone.m, image/cool.m, image/copper.m, diff --git a/scripts/plot/private/__plt__.m b/scripts/plot/private/__plt__.m --- a/scripts/plot/private/__plt__.m +++ b/scripts/plot/private/__plt__.m @@ -80,12 +80,12 @@ endif if (y_set) tmp = __plt2__ (h, x, y, options, properties); - [hlgnd, tlgnd] = __plt_key__ (tmp, options); + [hlgnd, tlgnd] = __plt_key__ (tmp, options, hlgnd, tlgnd); properties = {}; retval = [retval; tmp]; else tmp = __plt1__ (h, x, options, properties); - [hlgnd, tlgnd] = __plt_key__ (tmp, options); + [hlgnd, tlgnd] = __plt_key__ (tmp, options, hlgnd, tlgnd); properties = {}; retval = [retval; tmp]; endif @@ -98,7 +98,7 @@ if (y_set) options = __pltopt__ (caller, {""}); tmp = __plt2__ (h, x, y, options, properties); - [hlgnd, tlgnd] = __plt_key__ (tmp, options); + [hlgnd, tlgnd] = __plt_key__ (tmp, options, hlgnd, tlgnd); retval = [retval; tmp]; x = next_arg; y_set = false; @@ -123,9 +123,7 @@ endfunction -function [hlgnd, tlgnd] = __plt_key__ (h, options) - hlgnd = []; - tlgnd = {}; +function [hlgnd, tlgnd] = __plt_key__ (h, options, hlgnd, tlgnd) n = numel (h); if (numel (options) == 1) options = repmat (options(:), n, 1); @@ -134,7 +132,7 @@ for i = 1 : n key = options.key; if (! isempty (key)) - hlgnd = [h(i), h(i)]; + hlgnd = [hlgnd(:), h(i)]; tlgnd = {tlgnd{:}, key}; endif endfor