# HG changeset patch # User Rik # Date 1380844099 25200 # Node ID 225ec9a0222a9fcbd4c5962dc944ea0553b97491 # Parent 6363302926854e831883c6d0d1c10b60f38128bb legend.m: Use axis that legend refers to when calculating color for surface patch label. * scripts/plot/legend.m: Use axis that legend refers to when calculating color for surface patch label. diff -r 636330292685 -r 225ec9a0222a scripts/plot/legend.m --- a/scripts/plot/legend.m Thu Oct 03 16:47:47 2013 -0700 +++ b/scripts/plot/legend.m Thu Oct 03 16:48:19 2013 -0700 @@ -880,11 +880,12 @@ "cdata", cdata, "userdata", hplots(k)); hobjects(end+1) = p1; endif + ## FIXME: Probably need listeners, as for line objects case "surface" facecolor = get (hplots(k), "facecolor"); edgecolor = get (hplots(k), "edgecolor"); - cdata = sum (caxis ()) / 2; + cdata = sum (get (ca(1), "clim")) / 2; if (! strcmp (facecolor, "none") || ! strcmp (edgecolor, "none")) p1 = patch ("xdata", ([0, linelength, linelength, 0] + xoffset + xk * xstep) / lpos(3), @@ -894,6 +895,7 @@ "cdata", cdata, "userdata", hplots(k)); hobjects(end+1) = p1; endif + ## FIXME: Probably need listeners, as for line objects endswitch