[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: surface problem (?)
From: |
Kai Habel |
Subject: |
Re: surface problem (?) |
Date: |
Fri, 14 Mar 2008 08:43:13 +0100 |
User-agent: |
Thunderbird 2.0.0.9 (X11/20070801) |
Kai Habel schrieb:
> Hello all,
>
> I noticed a strange problem with surf/mesh today. Can someone confirm
> the following behavior?
>
> I use today's tip. (hg pull + hg update) and gnuplot 4.2.3.
>
> The command sequences below should all plot all the surface you would
> get from "mesh(peaks)" but in some case it does not.
>
> Lets start with the first example:
>
> octave:1> s=surf(peaks)
> s = -2.7829
> octave:2> set(s,'FaceColor','w')
> octave:3> set(s,'EdgeColor','flat') <-- red mesh!
> octave:4> drawnow("wxt","/dev/null",false,"/tmp/mesh1.gp")
> octave:5> clf
> octave:6> s=surf(peaks)
> s = -5.4186
> octave:7> set(s,'EdgeColor','flat')
> octave:8> set(s,'FaceColor','w') <-- red mesh!
> octave:9> drawnow("wxt","/dev/null",false,"/tmp/mesh2.gp")
>
> After command #3 I see a red colored mesh with hidden line removal.
> After command #8 I see the same red colored mesh as before. In both
> cases I would have expected a mesh with a color determined by the z-value.
>
> But now the strange sequence, at least here on my PC.
>
> octave:1> s=surf(peaks)
> s = -2.2645
> octave:2> set(s,'EdgeColor','flat')
> octave:3> set(s,'FaceColor','w') <- o.k
> octave:4> drawnow("wxt","/dev/null",false,"/tmp/mesh3.gp")
> octave:5> clf
> octave:6> s=surf(peaks)
> s = -5.3517
> octave:7> set(s,'FaceColor','w')
> octave:8> set(s,'EdgeColor','flat') <- red mesh
> octave:9> drawnow("wxt","/dev/null",false,"/tmp/mesh4.gp")
>
> After command #3 I see the correct surface (!) and after command #8 the
> red mesh again.
>
> All files "/tmp/mesh{1|2|3|4}.gp" are identical.
>
> address@hidden:~$ diff -u /tmp/mesh1.gp /tmp/mesh2.gp
> address@hidden:~$ diff -u /tmp/mesh1.gp /tmp/mesh3.gp
> address@hidden:~$ diff -u /tmp/mesh1.gp /tmp/mesh4.gp
>
> And if I load the file in gnuplot the surface looks o.k.
>
> address@hidden:~$ gnuplot
>
> G N U P L O T
> Version 4.2 patchlevel 3
> last modified Mar 2008
> System: Linux 2.6.22.17-0.1-default
>
> Copyright (C) 1986 - 1993, 1998, 2004, 2007, 2008
> Thomas Williams, Colin Kelley and many others
>
> Type `help` to access the on-line reference manual.
> The gnuplot FAQ is available from http://www.gnuplot.info/faq/
>
> Send bug reports and suggestions to
> <http://sourceforge.net/projects/gnuplot>
>
>
> Terminal type set to 'wxt'
> gnuplot> load "/tmp/mesh1.gp"
> gnuplot> load "/tmp/mesh2.gp"
> gnuplot> load "/tmp/mesh3.gp"
> gnuplot> load "/tmp/mesh4.gp"
>
>
> So, can someone confirm this behavior? Any ideas where to look at?
>
> Kai
>
>
O.k. the attached ChangeSet should fix the problem reported above.
Kai
# HG changeset patch
# User address@hidden
# Date 1205480422 -3600
# Node ID 5dbd0fc645c9f15611e6a7bc7fb836e0f3ae89c7
# Parent b7ed7fa807f87e88966baabd58b909f332b22967
Bug fix, set splot user style to default
diff -r b7ed7fa807f8 -r 5dbd0fc645c9 scripts/ChangeLog
--- a/scripts/ChangeLog Tue Mar 11 20:50:18 2008 +0100
+++ b/scripts/ChangeLog Fri Mar 14 08:40:22 2008 +0100
@@ -1,3 +1,8 @@ 2008-03-11 Kai Habel <address@hidden
+2008-03-14 Kai Habel <address@hidden>
+
+ * plot/__go_draw_axes__.m: Expicitly set gnuplot user
+ style to default to avoid wrong mesh color in some cases.
+
2008-03-11 Kai Habel <address@hidden>
* plot/__go_draw_axes__.m: Plot surfaces in front of axes.
diff -r b7ed7fa807f8 -r 5dbd0fc645c9 scripts/plot/__go_draw_axes__.m
--- a/scripts/plot/__go_draw_axes__.m Tue Mar 11 20:50:18 2008 +0100
+++ b/scripts/plot/__go_draw_axes__.m Fri Mar 14 08:40:22 2008 +0100
@@ -881,12 +881,12 @@ function __go_draw_axes__ (h, plot_strea
|| (isnumeric (obj.facecolor)
&& all (obj.facecolor == 1)));
hidden_removal = false;
-
+ fputs (plot_stream, "set style increment default;\n");
if (flat_interp_edge && facecolor_none_or_white)
withclause{data_idx} = "with line palette";
fputs (plot_stream, "unset pm3d\n");
if (all (obj.facecolor == 1))
- hidden_removal = true;
+ hidden_removal = true;
endif
elseif (facecolor_none_or_white)
edgecol = obj.edgecolor;