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: Kai Habel
Subject: Re: Why does "mesh " set surface "facecolor" to "none"?
Date: Thu, 08 Nov 2007 22:18:13 +0100
User-agent: Thunderbird 2.0.0.6 (X11/20070801)

Michael Goffioul schrieb:
> Matlab sets it to [1 1 1] by default, which looks better.
>
> Other remarks concerning "mesh":
> 1) axes properties ("view") should only be changed if the axes object
> is not in hold mode (that is gca.nextplot is not "add")
> 2) box should be disabled and grid should be enabled (again only in
> non-hold mode)
>
> The above remarks actually applies to any standard function producing
> 3D plots (surf, mesh, bar3...).
>
> Michael.
>
>   
For the other remarks I propose the attached patches.

Kai

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

  * plot/surface.m: set {x|y|z}grid "on", box "off", and view [0 90] only when 
hold is not on 
  * plot/mesh.m: set view [-37.5, 30] only when hold is not on 
  * plot/surf.m: set view [-37.5, 30] only when hold is not on 


--- mesh.m      2007-11-08 22:05:56.000000000 +0100
+++ mesh.m.new  2007-11-08 22:04:27.000000000 +0100
@@ -41,7 +41,9 @@
   set (tmp, "facecolor", "none");
   set (tmp, "edgecolor", "flat");
 
-  set (ax, "view", [-37.5, 30]);
+  if (!strncmp(get(ax,"nextplot"),"add",3))
+    set (ax, "view", [-37.5, 30]);
+  endif
 
   if (nargout > 0)
     h = tmp;
--- surf.m      2007-11-08 22:05:56.000000000 +0100
+++ surf.m.new  2007-11-08 22:04:04.000000000 +0100
@@ -38,8 +38,9 @@
   ax = get (tmp, "parent");
 
   set (tmp, "facecolor", "flat");
-
-  set (ax, "view", [-37.5, 30]);
+  if (!strncmp(get(ax,"nextplot"),"add",3))
+    set (ax, "view", [-37.5, 30]);
+  endif
 
   if (nargout > 0)
     h = tmp;
--- surface.m   2007-11-08 22:05:56.000000000 +0100
+++ surface.m.new       2007-11-08 22:04:10.000000000 +0100
@@ -84,10 +84,12 @@
 
   ## Make a default surface object.
   tmp = __go_surface__ (ax, "xdata", x, "ydata", y, "zdata", z, "cdata", c);
-
-  set (ax, "view", [0, 90], "box", "off");
   set (tmp, "facecolor","flat");
 
+  if (!strncmp(get(ax,"nextplot"),"add",3))
+    set (ax, "view", [0, 90], "box", "off", "xgrid", "on", "ygrid", "on", 
"zgrid", "on");
+  endif
+
   if (nargout > 0)
     h = tmp;
   endif

reply via email to

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