octave-maintainers
[Top][All Lists]
Advanced

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

Re: Why does "mesh " set surface "facecolor" to "none"?


From: David Bateman
Subject: Re: Why does "mesh " set surface "facecolor" to "none"?
Date: Fri, 09 Nov 2007 23:03:04 +0100
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

I had a one line fix,

diff -u -r1.63 __go_draw_axes__.m
--- __go_draw_axes__.m  9 Nov 2007 21:07:24 -0000       1.63
+++ __go_draw_axes__.m  9 Nov 2007 21:56:00 -0000
@@ -702,7 +702,7 @@
              palette_data = [1:rows(surf_colormap); surf_colormap'];
             endif

-            if (isnumeric (obj.facecolor))
+            if (isnumeric (obj.facecolor) && ! all (obj.facecolor == 1))
               palette_data = [1:2; [obj.facecolor; obj.facecolor]'];
             endif

but you beat me to it, with something similar.. Your patch works for
both gnuplot 4.0 and 4.2.2

D.

John W. Eaton wrote:
> On  9-Nov-2007, John W. Eaton wrote:
> 
> | On  9-Nov-2007, David Bateman wrote:
> | 
> | | Opps, wrong version of the patch included.. Use the attached version
> | | instead.
> | 
> | I applied this patch and checked it in.  However, now when I run
> | sombrero, the surface is displayed as all white.  I can see it is
> | there because it is obscuring the grid lines.  Is it just me?
> | 
> | If I do
> | 
> |   sombrero
> |   hidden off
> | 
> | a mesh appears, but I was expecting hidden line removal and colors as
> | before.
> | 
> | I would like to make a new snapshot soon, so any help here would be
> | much appreciated.
> 
> I checked in the following fix for this problem.  It seems to work for
> me, but it would help if someone more familiar with the facecolor and
> edgecolor properties could verify that this change is OK.
> 
> Thanks,
> 
> jwe
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> scripts/ChangeLog:
> 
> 2007-11-09  John W. Eaton  <address@hidden>
> 
>       * plot/__go_draw_axes__.m: Correct logic in setting palette data.
> 
> 
> Index: scripts/plot/__go_draw_axes__.m
> ===================================================================
> RCS file: /cvs/octave/scripts/plot/__go_draw_axes__.m,v
> retrieving revision 1.63
> diff -u -u -r1.63 __go_draw_axes__.m
> --- scripts/plot/__go_draw_axes__.m   9 Nov 2007 21:07:24 -0000       1.63
> +++ scripts/plot/__go_draw_axes__.m   9 Nov 2007 21:25:51 -0000
> @@ -688,6 +688,10 @@
>                               || strncmp (obj.facecolor, "interp", 6));
>              flat_interp_edge = (strncmp (obj.edgecolor, "flat", 4)
>                               || strncmp (obj.edgecolor, "interp", 6));
> +
> +         facecolor_none_or_white = (strncmp (obj.facecolor, "none", 4)
> +                                    || (isnumeric (obj.facecolor)
> +                                        && all (obj.facecolor == 1)));
>              palette_data = [];
>  
>           if (strncmp (obj.facecolor, "none", 4))
> @@ -695,27 +699,18 @@
>           endif
>  
>              if (flat_interp_face
> -             || (flat_interp_edge
> -                 && (strncmp (obj.facecolor, "none", 4)
> -                     || (isnumeric (obj.facecolor)
> -                         && all (obj.facecolor == 1)))))
> +             || (flat_interp_edge && facecolor_none_or_white))
>                palette_data = [1:rows(surf_colormap); surf_colormap'];
> -            endif
> -
> -            if (isnumeric (obj.facecolor))
> +         elseif (isnumeric (obj.facecolor))
>                palette_data = [1:2; [obj.facecolor; obj.facecolor]'];
>              endif
>  
> -
> -         if ((strncmp (obj.facecolor, "none", 4)
> -              || (isnumeric (obj.facecolor)
> -                  && all (obj.facecolor == 1)))
> -             && isnumeric (obj.edgecolor))
> +         if (facecolor_none_or_white && isnumeric (obj.edgecolor))
>                palette_data = [1:2; [obj.edgecolor; obj.edgecolor]'];
>              endif
>  
> -         if (strncmp (obj.facecolor, "none", 4)
> -             || (isnumeric (obj.facecolor) && all (obj.facecolor == 1)))
> +         if (facecolor_none_or_white)
> +           ## Do nothing.
>              elseif (flat_interp_face && strncmp (obj.edgecolor, "flat", 4))
>                fprintf (plot_stream, "set pm3d at s %s;\n", interp_str);
>              else



reply via email to

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