[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: |
Fri, 09 Nov 2007 08:53:37 +0100 |
User-agent: |
Thunderbird 2.0.0.6 (X11/20070801) |
John W. Eaton schrieb:
> On 8-Nov-2007, Kai Habel wrote:
>
> | 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.
>
> | --- 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;
>
> I think it would be better to use
>
> if (ishold ())
> ...
> endif
>
> Will you please make that change and send the patch again?
>
> Thanks,
>
> jwe
>
>
O.k. here is a revised patch, a similar change and bug fix for pcolor.m
Kai
--- mesh.m 2007-11-08 22:05:56.000000000 +0100
+++ mesh.m.new 2007-11-09 08:37:14.000000000 +0100
@@ -41,7 +41,9 @@
set (tmp, "facecolor", "none");
set (tmp, "edgecolor", "flat");
- set (ax, "view", [-37.5, 30]);
+ if (!ishold())
+ set (ax, "view", [-37.5, 30]);
+ endif
if (nargout > 0)
h = tmp;
--- pcolor.m 2007-11-09 08:44:20.000000000 +0100
+++ pcolor.m.new 2007-11-09 08:43:53.000000000 +0100
@@ -45,13 +45,15 @@
print_usage ();
endif
- tmp = surface (X, Y, Z, c);
+ tmp = surface (x, y, z, c);
ax = get (tmp, "parent");
set (tmp, "facecolor", "flat");
-
- set (ax, "view", [0, 90]);
+
+ if (!ishold())
+ set (ax, "view", [0, 90]);
+ endif
if (nargout > 0)
h = tmp;
--- surf.m 2007-11-08 22:05:56.000000000 +0100
+++ surf.m.new 2007-11-09 08:36:56.000000000 +0100
@@ -38,8 +38,9 @@
ax = get (tmp, "parent");
set (tmp, "facecolor", "flat");
-
- set (ax, "view", [-37.5, 30]);
+ if (!ishold())
+ 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-09 08:36:23.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 (!ishold())
+ set (ax, "view", [0, 90], "box", "off", "xgrid", "on", "ygrid", "on",
"zgrid", "on");
+ endif
+
if (nargout > 0)
h = tmp;
endif
- Re: Why does "mesh " set surface "facecolor" to "none"?, (continued)
- Re: Why does "mesh " set surface "facecolor" to "none"?, David Bateman, 2007/11/09
- Re: Why does "mesh " set surface "facecolor" to "none"?, David Bateman, 2007/11/09
- Re: Why does "mesh " set surface "facecolor" to "none"?, John W. Eaton, 2007/11/09
- Re: Why does "mesh " set surface "facecolor" to "none"?, David Bateman, 2007/11/09
- Re: Why does "mesh " set surface "facecolor" to "none"?, John W. Eaton, 2007/11/09
- Re: Why does "mesh " set surface "facecolor" to "none"?, David Bateman, 2007/11/09
- Re: Why does "mesh " set surface "facecolor" to "none"?, John W. Eaton, 2007/11/09
- Re: Why does "mesh " set surface "facecolor" to "none"?, David Bateman, 2007/11/09
Re: Why does "mesh " set surface "facecolor" to "none"?, Kai Habel, 2007/11/08