# HG changeset patch # User Konstantinos Poulios # Date 1339141903 -7200 # Node ID daad312c8af019aa2134b4c52a562f86accc0685 # Parent 3ddb62bd67c5ca6e56f31711242c52cc5cbf3d99 legend.m: Add support for patches (Bugs #33463, #34881, #35260). diff --git a/scripts/plot/legend.m b/scripts/plot/legend.m --- 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), ...