I've got a data file which contains a bunch of x
, y
and z
points. I'd like to use gnuplot
to plot out these points with pm3d
but this requires me to turn on set dgrid 10,10,1
(the number should be different). THe problem is that my data gets warped (the points don't lay on the pm3d
surface when I plot them out together).
How should I use dgrid3d
? The points are generated from a c++
program, so I can choose the x and y spacing myself.
My data looks like this:
# X Y Z
1 2 3
2 2 4
...
I'd like it to be a colored surface that runs through these points in 3D space. The x
and y
data is spaced evenly, while the z
data is a function of x
and y
points.
If you have your data available in a file Data.dat
then give this a try:
set dgrid3d 10,10
set style data lines
set pm3d
splot "Data.dat" pal
dgrid3d
tells gnuplot how many entries there are in the x- and y-direction (those are the two comma separated parameters)style data lines
lets gnuplot plot the result with lines instead of pointspm3d
fills the surface with a color (if you leave this away you will just see the lines)pal
makes the lines appear in the color of the specified valueThere are much more options you can set, but i find those the most relevant.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With