I assume your issue is the datafile separator
.
If you look at the point_data.dat
file, I'm sure it will list your points in columns but not separated by ;
. Thus, when you attempt to plot both the point_data.dat
and the field.csv
(which I assume is separated by ;
as well), the points will most likely not be plotted because gnuplot cannot interpret the point_data.dat
-file (which uses the default separator of " "
).
There are two ways to overcome this:
Do not use
set datafile separator
. Instead, useawk
to remove the;
while plotting:set decimalsign locale set table 'point_data.dat' unset dgrid3d splot "< awk 'BEGIN {FS=\";\"} {print $1, $2, $3}' points.csv" u 1:2:3 unset table set dgrid3d 50,50,50 splot "point_data.dat" u 1:2:3 w points pt 7, \ "< awk 'BEGIN {FS=\";\"} {print $1, $2, $3}' field.csv" u 2:1:3 with lines lt 5 lc rgb "#000000"
A few things to notice:
- inside the
awk
-command, do not forgot to use backslashes with the quotation marks:\"
or else it will mess up the command (and result in an error). - consider unsing
not
to suppress a legend entry or use a defined title (e.g.title "points"
), otherwise the wholeawk
-command will be printed as title.
- inside the
You can use the
multiplot
-command (and skip theset table
):set datafile separator ";" set xrange [xmin:xmax] set yrange [ymin:ymax] set zrange [zmin:zmax] set multiplot splot "points.csv" u 1:2:3 w points pt 7 not set dgrid3d 50,50,50 splot "field.csv" u 2:1:3 with lines lt 5 lc rgb "#000000" not unset dgrid3d unset multiplot
A few things to notice:
- use
not
to print without legend, or else they will overlap. If you need a legend, you cannot usemultiplot
like this, because they will overlap. - set the
xrange
,yrange
andzrange
before you plot, or else the axis ranges might not agree. (Be sure to replacexmin
etc with the actual values from your data range).
- use