I would like to plot different points with different colors and symbols. Here is my Code in "C" :
float x[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
float y[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
FILE *gnuplot = popen("gnuplot", "w");
fprintf(gnuplot, "plot '-' pt 7 pointsize 2 lc \"blue\" notitle \n");
for (int i = 0; i < 6; ++i) {
fprintf(gnuplot,"%f %f\n", x[i], y[i]);
}
fprintf(gnuplot, "plot '-' pt 5 pointsize 2 lc \"red\" notitle \n");
for (int i = 6; i < 12; ++i) {
fprintf(gnuplot,"%f %f\n", x[i], y[i]);
}
fprintf(gnuplot, "e\n");
fflush(gnuplot);
getch();
fclose(gnuplot);
Unfortunately, all points have the same type and same color. What is my mistake? Thanks in advance!
Edit:
All points are blue and have the pointtype 7 and the pointsize 2. The second command line to change the style has no effect:
fprintf(gnuplot, "plot '-' pt 5 pointsize 2 lc \"red\" notitle \n");
