ACR
ACR

Reputation: 81

Gnuplot: Hidden3D

Is there a way I can hide these overlayed lines in the back of my plot? I tried to use the hidden3d option, but it doesn't work as I expected.

set encoding utf8
set key right top

set xrange[0:1]
set yrange[0:1]

set grid
set ztics 0.01
set palette rgbformulae -5,-12,-30

set xlabel "x" font "Helvetica, 20"
set ylabel "y" font "Helvetica, 20"
set zlabel "z" font "Helvetica, 20"

set terminal postscript eps enhanced color font "Helvetica, 20"
set output "approx_jacobi.eps"

ue(x,y) = sin(pi*x)*sin(pi*y)/(2*pi**2);

#set hidden3d front
set dgrid3d 31, 31 qnorm 2
splot 'results.dat' with pm3d notitle,\
      ue(x,y) w l lw 2 t 'Exact'

The result I'm currently getting is

here it is

Upvotes: 3

Views: 2218

Answers (1)

Christoph
Christoph

Reputation: 48390

Using set hidden3d front works fine for me. I had to increase the isosamples a bit to avoid intersections of the lines with the surface due to the linear interpolation. Also you don't need to use set dgrid3d since you already have a regular grid.

set pm3d
set hidden3d front
set ticslevel 0
set isosamples 40
set palette rgbformulae -5,-12,-30

ue(x,y) = sin(pi*x)*sin(pi*y)/(2*pi**2)
splot 'results.dat' with pm3d, ue(x,y) w l

The result with 4.6.5 is:

enter image description here

Upvotes: 4

Related Questions