I am building a particle simulation, and I want to display each particle's position as a dot in a 3D scatter plot using MathGL in C (not C++!). I am having trouble with the C interface.
So far I found two interesting examples:
A C++ example that seems to be close to what I want: http://mathgl.sourceforge.net/doc_en/Dots-sample.html (but this is in C++, I have been unable to find the C-equivalent)
This is a piece of C code that constructs a 3D surf plot with dots. #include
int main()
{
HMGL gr = mgl_create_graph(600,400);
HMDT a,x,y;
a = mgl_create_data_size(30,40,1);
x = mgl_create_data_size(30,1,1);
y = mgl_create_data_size(40,1,1);
mgl_data_modify(a,"pi*(1-2*x)*exp(-4*y^2-4*(2*x-1)^2)",0);
mgl_data_fill(x,-1.,1.,'x');
mgl_data_fill(y,0.,1.,'x');
mgl_