octave-maintainers
[Top][All Lists]
Advanced

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

surface colors


From: Kai Habel
Subject: surface colors
Date: Tue, 27 Nov 2007 21:08:02 +0100
User-agent: Thunderbird 2.0.0.6 (X11/20070801)

Hello,

here is a patch that fixes the following problem:

(Yesterday I have sent this message accidentally to address@hidden
instead of address@hidden, so it was not forwarded to list.)

> while implementing the cylinder function, I noticed the following small
> problem with respect to surface colors.
> 
> If you try a simple surface:
> 
> pcolor(eye(3))
> 
> you can see 4 rectangles with a light blue or green color.
> 
> It seems gnuplot calculates the mean value for each rectangle (0.5 -
> green or 0.25 - light blue) and assigns the respective color. Matlab
> instead, uses the value of a single vertex (0 - dark blue, 1 - dark red).
> 
> I have played with the corners2color option of pm3d and if I add
> 'corners2color c3' to the pm3d calls, the colors are the same as matlab's.


2007-11-27  Kai Habel  <address@hidden>

  * plot/__go_draw_axes__.m: Set quadrilateral color according to
    z-value of vertex 'c3'.

--- __go_draw_axes__.m.orig     2007-11-27 20:51:18.000000000 +0100
+++ __go_draw_axes__.m  2007-11-27 20:52:31.000000000 +0100
@@ -939,18 +939,18 @@
              ## Ensure faces aren't drawn
              fprintf (plot_stream, "unset pm3d;\n");
             elseif (flat_interp_face && strncmp (obj.edgecolor, "flat", 4))
-              fprintf (plot_stream, "set pm3d at s %s %s;\n", 
+              fprintf (plot_stream, "set pm3d at s %s %s corners2color c3;\n", 
                       interp_str, dord);
             else
               if (strncmp (obj.edgecolor, "none", 4))
-                fprintf (plot_stream, "set pm3d at s %s ;\n", 
+                fprintf (plot_stream, "set pm3d at s %s corners2color c3;\n", 
                         interp_str, dord);
               else
                 edgecol = obj.edgecolor;
                 if (ischar (obj.edgecolor))
                   edgecol = [0,0,0];
                 endif
-                fprintf (plot_stream, "set pm3d at s hidden3d %d %s %s;\n", 
+                fprintf (plot_stream, "set pm3d at s hidden3d %d %s %s 
corners2color c3;\n", 
                         data_idx, interp_str, dord);
 
                if (have_newer_gnuplot)

reply via email to

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