I have this piece of code
int draw_cell_bary(char *filename, char *filenameOutput, int format){
char buff[500];
FILE *f;
char draw_name_file_pattern[] = "%s%s%s%s%s";
f = popen("gnuplot", "w");
//sprintf(buff, draw_name_file_pattern ,"plot '",filename,"' with lines,' \n set term postscript\n set output \"",filenameOutput,"\"\n replot\n");
switch(format){
case 1:
sprintf(buff, draw_name_file_pattern ,"plot '",filename,"' \n set terminal png\n set output \"",filenameOutput,"\"\n replot\n");
break;
sprintf(buff, draw_name_file_pattern ,"plot '",filename,"' \n set term postscript\n set output \"",filenameOutput,"\"\n replot\n");
case 2:
break;
}
fprintf(f,"%s", buff);
fflush(f);
pclose(f);
return 1;
}
This code works fine but when I use it to create a drawing, the window appears in a popup and is immediatly closed. I want that the window from gnuplot stays hidden and that the output is created without the user to see it.
I've found --noraise but I'm not sure if that's what I want.
Thanks