Can I do such a thing on gnuplot that it works? when buffer[i] == max change the color of the point
fprintf(gnuplot, "if (\"%d\" == \"%d\") plot '-' with lines lw2; else plot '-' with lines lw 1 \n", buffer[i], max);
for (i = 0; i < NUM_POINTS; i++)
{
fprintf(gnuplot, "%d %d \n", i,buffer[i]);
}