So I'm trying to make a plot using pm3d in gnuplot. Unfortunately I seem to run into the problem that the plot is created, with no points or lines on it.
Here is the code for the program that generates the points:
#include<stdio.h>
#include<math.h>
int main() {
double x = -10000;
double y = 0;
double z = 0;
FILE *cool = fopen("coolbeans.txt", "w");
fprintf(cool, "#x\ty\tz\n");
for (int i = 0; 1 < 10000; i++) {
x = x + 10;
y = sqrt(abs(x));
z = -200*(sin(x));
fprintf(cool, "%1.0f\t%f\t%f\n\n", x, y, z);
}
fclose(cool);
return 0;
}
Next I open gnuplot and enter the following commands:
set term jpeg size 3200, 1800
set output 'example.jpg'
splot 'coolbeans.txt' using 1:2:3 with pm3d
I then get this:
Any help would be very much appreciated!