[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
improvement for surface plots
From: |
Kai Habel |
Subject: |
improvement for surface plots |
Date: |
Tue, 11 Mar 2008 21:06:00 +0100 |
User-agent: |
Thunderbird 2.0.0.9 (X11/20070801) |
Hello all,
with the current tip surface plots do not look nice. The grid is plotted
in front of the surface. The attached patch makes two changes, first
surfaces are plotted in front of the grid, thus the surface looks opaque.
h = surf(peaks);
Second, for mesh plots an uniform color value works now.
h = mesh(peaks);
set(h,'EdgeColor','r');
But, to make this work a very recent gnuplot is required (4.2.3)
otherwise the mesh is not drawn. See also this [1] discussion.
Kai
[1]
http://www.nabble.com/Problem-with-mesh-plots-and-hidden-line-removal-td15905512.html
# HG changeset patch
# User address@hidden
# Date 1205265018 -3600
# Node ID b7ed7fa807f87e88966baabd58b909f332b22967
# Parent a74f9679535fcd9c03f7dbe47ecfe5446e1a5b73
Improvements for surface plots
diff -r a74f9679535f -r b7ed7fa807f8 scripts/ChangeLog
--- a/scripts/ChangeLog Tue Mar 11 11:08:43 2008 -0400
+++ b/scripts/ChangeLog Tue Mar 11 20:50:18 2008 +0100
@@ -1,3 +1,9 @@ 2008-03-07 John W. Eaton <address@hidden
+2008-03-11 Kai Habel <address@hidden>
+
+ * plot/__go_draw_axes__.m: Plot surfaces in front of axes.
+ Allow plotting of uniform colored mesh plots with and
+ w/o hidden line removal.
+
2008-03-07 John W. Eaton <address@hidden>
* plot/contourf.m: Set axes layer property to "top".
diff -r a74f9679535f -r b7ed7fa807f8 scripts/plot/__go_draw_axes__.m
--- a/scripts/plot/__go_draw_axes__.m Tue Mar 11 11:08:43 2008 -0400
+++ b/scripts/plot/__go_draw_axes__.m Tue Mar 11 20:50:18 2008 +0100
@@ -867,7 +867,7 @@ function __go_draw_axes__ (h, plot_strea
data{data_idx} = zz.';
endif
usingclause{data_idx} = "using ($1):($2):($3):($4)";
- ## fputs (plot_stream, "unset parametric;\n");
+ ## fputs (plot_stream, "unset parametric;\n");
## Interpolation does not work for flat surfaces (e.g. pcolor)
## and color mapping --> currently set empty.
@@ -880,17 +880,14 @@ function __go_draw_axes__ (h, plot_strea
facecolor_none_or_white = (strncmp (obj.facecolor, "none", 4)
|| (isnumeric (obj.facecolor)
&& all (obj.facecolor == 1)));
- if (strncmp (obj.facecolor, "none", 4))
- hidden_removal = false;
- else
- if (isnan (hidden_removal))
- hidden_removal = true;
- endif
- endif
+ hidden_removal = false;
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;
+ endif
elseif (facecolor_none_or_white)
edgecol = obj.edgecolor;
if (have_newer_gnuplot)
@@ -900,9 +897,14 @@ function __go_draw_axes__ (h, plot_strea
colorspec = sprintf ("linecolor rgb \"#%02x%02x%02x\"",
round (255*edgecol));
endif
+ if (all (obj.facecolor == 1))
+ hidden_removal = true;
+ endif
+ fputs(plot_stream,"unset pm3d;\n");
fprintf (plot_stream,
"set style line %d %s lw %f;\n",
data_idx, colorspec, obj.linewidth);
+ fputs(plot_stream,"set style increment user;\n");
else
typ = get_old_gnuplot_color (edgecol);
fprintf (plot_stream,
- improvement for surface plots,
Kai Habel <=