From c0d5d054ab422e86df6f8c5f128b620df46ecdc3 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Sun, 7 Aug 2016 21:58:42 +0200 Subject: [PATCH] gnuplot.c, ft_gnuplot(), suppress generating the .eps and .png file when the given output file name starts with "np_" --- src/frontend/plotting/gnuplot.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/frontend/plotting/gnuplot.c b/src/frontend/plotting/gnuplot.c index 6f62951ed..be1c2782b 100644 --- a/src/frontend/plotting/gnuplot.c +++ b/src/frontend/plotting/gnuplot.c @@ -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");