octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #48427] legend objects in gnuplot


From: Rik
Subject: [Octave-bug-tracker] [bug #48427] legend objects in gnuplot
Date: Thu, 7 Jul 2016 16:09:06 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Follow-up Comment #8, bug #48427 (project octave):

@Dan: legend.m sets the properties of the patch object for the legend based on
the surface.  Here is the code:


            case "surface"
              facecolor = get (hplt, "facecolor");
              edgecolor = get (hplt, "edgecolor");
              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),
                            "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", hplt);
                hobjects(end+1) = p1;
              endif


When facecolor is "flat", rather than an RGB specification, then the color
comes from the cdata property.

Trivial example:


hp = patch;  # triangle patch, colored black
get (hp, 'facecolor')
ans =

   0   0   0
set (hp, 'cdata', [0 1 0]);  # set cdata to green, patch is still black
set (hp, 'facecolor', 'flat');  # now patch becomes green.


So, I think you just need to copy over the properties "facecolor",
"edgecolor", and "cdata".




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?48427>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]