I am writing a program for event driven simulation of elastic collision of spherical balls(in 2D). As a output of the program I am collecting the collision points into a log file(say, data.temp) and plotting them using gnuplot.
I am following the instructions discussed here in this link. My output log file looks like this.
DATA.TEMP(All points are not shown)
20.000000 0.000000
3.535534 0.000000
3.535534 0.000000
45.000000 33.508349
-20.000000 -2.500000
-3.535534 -2.500000
-3.535534 -2.500000
-47.500000 -38.028654
-47.500000 -38.028654
The command used for gnuplot
char* commandForGnuplot[] = {"set title \"Path Plot\"","plot 'data.temp' with linespoints"};
I am able to get a plot like this
I want the paths for different balls to be colored differently. The color should be an input from the user. How can I do this?