Mercurial > hg > octave-nkf
changeset 14747:daad312c8af0
legend.m: Add support for patches (Bugs #33463, #34881, #35260).
author | Konstantinos Poulios <logari81@gmail.com> |
---|---|
date | Fri, 08 Jun 2012 09:51:43 +0200 |
parents | 3ddb62bd67c5 |
children | ec924357b375 |
files | scripts/plot/legend.m |
diffstat | 1 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/plot/legend.m +++ b/scripts/plot/legend.m @@ -715,6 +715,18 @@ addlistener(hplots(k), "markersize", {@updateline, hlegend, linelength}); addlistener(hplots(k), "displayname", {@updateline, hlegend, linelength}); case "patch" + facecolor = get (hplots(k), "facecolor"); + edgecolor = get (hplots(k), "edgecolor"); + cdata = get (hplots(k), "cdata"); + if (! strcmp (facecolor, "none") || ! strcmp (edgecolor, "none")) + p1 = patch ("xdata", ([0, linelength, linelength, 0] + + xoffset + xk * xstep) / lpos(3), + "ydata", (lpos(4) - yoffset - + [yk-0.3, yk-0.3, yk+0.3, yk+0.3] .* ystep) / lpos(4), + "facecolor", facecolor, "edgecolor", edgecolor, "cdata", cdata, + "userdata", hplots (k)); + hobjects = [hobjects, p1]; + endif case "surface" endswitch set (texthandle (k), "position", [(txoffset + xk * xstep) / lpos(3), ...