Lesheng Li
Lesheng Li

Reputation: 25

Weird lines during Gnuplotting

I am trying to plot a 3D figure using Gnuplot, but it gives me some weird lines (valleys) along Y-axis which are not supposed to be there. It seems like my command is not plotting along X-axis properly. And when I change set dgrid3d 300,300 to other values such as 500,500 or 700,700, the number of these weird lines changes as well as their positions. My data file has 2084 points in the X-axis and 125 points in the Y-axis. Hope someone can help me on this.

The following is my command:

set terminal postscript color
set output "Figure.ps"
unset key
set xlabel "X"
set ylabel "Y"
set zlabel "Z"
set xr [0:2084]
set yr [-.99621756724589383480:1.89823137348250416567]
set zr [0:0.025]
set pm3d
set pm3d interpolate 0,0
set palette defined (20 "black", 40 "green", 55 "blue", 70 "orange", 100 "red")
set cbrange [0:0.025]
set ticslevel 0.0001
set dgrid3d 300,300
set hidden3d
set view 45, 345
splot "data" u 2:1:3 w l

and this is the result:

This is the result

Upvotes: 2

Views: 402

Answers (1)

Christoph
Christoph

Reputation: 48440

I think the dgrid3d settings together with your clipping of higher z-values gives you this totally distorted representation of the data.

Consider the following, simplified plot of your data:

set terminal postscript eps
set output 'Figure.ps'

set autoscale xfix
set autoscale yfix
set pm3d
set palette defined (20 "black", 40 "green", 55 "blue", 70 "orange", 100 "red")
set zrange [0:0.3]
set cbrange [0:0.1]
set ticslevel 0
set view 64,104
splot 'data' u 2:1:3 with pm3d notitle

This gives the following result (tested with 4.6.5):

enter image description here

Upvotes: 1

Related Questions