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 38af3247d1
commit c1f289c241
1 changed files with 14 additions and 9 deletions

View File

@ -236,16 +236,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");