#include <iostream>
#include <cmath>
#include <gnuplot-iostream.h>
int main() {
Gnuplot gp;
// Define the independent variables
std::vector<double> xValues, yValues, zValues;
// Generate data points for the independent variables
for (double x = -10.0; x <= 10.0; x += 0.1) {
for (double y = -10.0; y <= 10.0; y += 0.1) {
xValues.push_back(x);
yValues.push_back(y);
zValues.push_back(/ Your function of x and y /);
}
}
// Plot the data points
gp << "set hidden3d\n";
gp << "splot '-' using 1:2:3 with points\n";
for (size_t i = 0; i < xValues.size(); ++i) {
gp << xValues[i] << " " << yValues[i] << " " << zValues[i] << "\n";
}
gp << "e\n";
return 0;
}