octave-maintainers
[Top][All Lists]
Advanced

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

[Patch] Re: Bug in octave/gnuplot surface code?


From: David Bateman
Subject: [Patch] Re: Bug in octave/gnuplot surface code?
Date: Tue, 20 Nov 2007 11:04:24 +0100
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

David Bateman wrote:
> Kai,
>
> The sphere function from JHandles is entirely independent of JHandles
> itself as as a core function should probably migrate to Octave. However,
> I tried it out and got some very strange rendering errors with the
> gnuplot x11 terminal, that I believe are an issue in gnuplot, though it
> might be sometime in your recently introduced "surface" code.. Could you
> try the attached function, just typing "sphere()" to get a default
> surface plot. In particular the rendering errors are made very obvious
> if you rotate the sphere with the mouse..
>
> If this is a bug either in Octave or gnuplot we are likely to see other
> issues with surface plots..
>
> D.
>
>   
Ok, I figured it out.. In the "set pm3d" command we need the
"depthorder" argument to sort the surface patches by their depth when
they are rendered. However, this option doesn't exist in gnuplot 4.0,
and so this is another case where gnuplot 4.0 breaks things..

Patch attached.

D.


-- 
David Bateman                                address@hidden
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary

*** ./scripts/plot/__go_draw_axes__.m.orig15    2007-11-20 10:53:10.567201309 
+0100
--- ./scripts/plot/__go_draw_axes__.m   2007-11-20 10:58:55.282903777 +0100
***************
*** 898,916 ****
                palette_data = [1:2; [obj.edgecolor; obj.edgecolor]'];
              endif
  
            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
                if (strncmp (obj.edgecolor, "none", 4))
!                 fprintf (plot_stream, "set pm3d at s %s;\n", interp_str);
                else
                  edgecol = obj.edgecolor;
                  if (ischar (obj.edgecolor))
                    edgecol = [0,0,0];
                  endif
!                 fprintf (plot_stream, "set pm3d at s hidden3d %d %s;\n", 
data_idx, interp_str);
  
                if (have_newer_gnuplot)
                    fprintf (plot_stream,
--- 898,926 ----
                palette_data = [1:2; [obj.edgecolor; obj.edgecolor]'];
              endif
  
+ 
+           if (have_newer_gnuplot)
+             dord = "depthorder";
+           else
+             dord = "";
+           endif
+ 
            if (facecolor_none_or_white)
              ## Do nothing.
              elseif (flat_interp_face && strncmp (obj.edgecolor, "flat", 4))
!               fprintf (plot_stream, "set pm3d at s %s %s;\n", 
!                      interp_str, dord);
              else
                if (strncmp (obj.edgecolor, "none", 4))
!                 fprintf (plot_stream, "set pm3d at s %s ;\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", 
!                        data_idx, interp_str, dord);
  
                if (have_newer_gnuplot)
                    fprintf (plot_stream,
2007-11-20  David Bateman  <address@hidden>

        * plot/__go_draw_axes__.m: Add depthorder flag to "set pm3d" to
        sort surface patches by their depth and not the order they are
        rendered in.

reply via email to

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