gnuplot.c, ft_gnuplot(), suppress generating the .eps and .png file

when the given output file name starts with "np_"
This commit is contained in:
h_vogt 2016-08-07 21:58:42 +02:00 committed by rlar
parent 42ac9a2859
commit c0d5d054ab
1 changed files with 14 additions and 9 deletions

View File

@ -232,16 +232,21 @@ ft_gnuplot(double *xlims, double *ylims, char *filename, char *title, char *xlab
}
}
fprintf(file, "\n");
fprintf(file, "set terminal push\n");
if (terminal_type == 1) {
fprintf(file, "set terminal postscript eps color noenhanced\n");
fprintf(file, "set out \'%s.eps\'\n", filename);
} else {
fprintf(file, "set terminal png noenhanced\n");
fprintf(file, "set out \'%s.png\'\n", filename);
/* do not print an eps or png file if filename start with 'np_' */
if (!ciprefix("np_", filename)) {
fprintf(file, "set terminal push\n");
if (terminal_type == 1) {
fprintf(file, "set terminal postscript eps color noenhanced\n");
fprintf(file, "set out \'%s.eps\'\n", filename);
}
else {
fprintf(file, "set terminal png noenhanced\n");
fprintf(file, "set out \'%s.png\'\n", filename);
}
fprintf(file, "replot\n");
fprintf(file, "set term pop\n");
}
fprintf(file, "replot\n");
fprintf(file, "set term pop\n");
fprintf(file, "replot\n");