Reputation: 945
I am currently writing a paper for my Degree and I have a problem with 3 Graphs that I am trying to plot using Gnuplot.
I got some data points which look like this:
...
100.000000 0.120000 2.000000 0.052724 6682.801488
100.000000 0.130000 2.000000 0.055570 6805.632674
100.000000 0.140000 2.000000 0.058270 6912.462994
100.000000 0.150000 2.000000 0.060815 7006.219537
100.000000 0.160000 2.000000 0.063252 7098.284918
100.000000 0.170000 2.000000 0.065541 7621.135706
100.000000 0.180000 2.000000 0.067744 8383.880473
100.000000 0.190000 2.000000 0.069822 9030.334374
100.000000 0.200000 2.000000 0.071812 9574.679479
100.000000 0.210000 2.000000 0.073712 10001.423400
100.000000 0.220000 2.000000 0.075520 10324.290168
100.000000 0.230000 2.000000 0.077267 10577.919498
100.000000 0.240000 2.000000 0.078932 10731.859176
100.000000 0.250000 2.000000 0.080537 10781.566931
100.000000 0.260000 2.000000 0.082081 10687.175109
100.000000 0.270000 2.000000 0.083562 10580.855944
100.000000 0.280000 2.000000 0.085001 10526.856376
100.000000 0.290000 2.000000 0.086381 10581.738511
100.000000 0.300000 2.000000 0.087723 10731.950591
100.000000 0.310000 2.000000 0.089018 10909.067948
100.000000 0.320000 2.000000 0.090281 11099.323889
100.000000 0.330000 2.000000 0.091511 11296.953911
100.000000 0.340000 2.000000 0.092710 11499.793402
100.000000 0.350000 2.000000 0.093879 11702.881224
...
where the first column represents my x-values ranging from [100-1000]
in steps of 10
.
The second column displays my y-values ranging from about [0-3]
in steps of 0.01
.
I am trying to plot the third column as a 2d color plot.
But for some reason I get these artifacts. I tried adjusting the grid size up and down. Here is my code:
### interpolate data with highlighted datapoints
reset session
#set terminal postscript eps enhanced color font 'Helvetica,10'
# ---------------------------------------------------------------------------------------
#set output './production/SpeedKraft.eps'
set title ""
set xrange [100:1000]
set yrange [0.01:2.5]
set xlabel ""
set ylabel "" rotate by 90
# ---------------------------------------------------------------------------------------
set palette grey
set grid
set size square
set view map
set pm3d at b
# set pm3d interpolate 2,2
set dgrid3d 1000,1000 qnorm 2
set table $DataInterpolated
splot "SpeedNeu.dat" u 1:2:3
unset table
unset dgrid3d
set format y "%.1f"
set format x "%.0f"
splot $DataInterpolated u 1:2:3 w pm3d palette notitle, \
# "Speed.dat" u 1:2:3 w p pt 1 lw 2 lc rgb "black" notitle
### end of code
I am very happy if someone could help me out on this one!
Regards Finn
Upvotes: 1
Views: 109
Reputation: 15093
Using dgrid3d to create an interpolated 3D surface seems more likely to obscure the data structure by overfitting than it is to enlighten. Have you tried the much simpler
plot "SpeedNeu.dat" using 1:2:3 with image
or even
plot "SpeedNeu.dat" using 1:2:3 with points pt 5 lc palette
Edited to show handling of missing points and space between points
set pointsize 7.2 # exact size found by experimentation
# I left a tiny gap so you can see it, 7.3 would remove it
set size square
set colorbar user origin 0.9,0.2 size 0.05,0.6
unset border; unset tics; unset key
plot "fake.data" using 1:2:3 with points pt 5 lc palette
Upvotes: 2