From 8efa08602a4f89d1c351a199eb07ea6a874ca962 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sat, 23 Feb 2019 23:36:47 +0100 Subject: [PATCH] no plotting, only saving to file if gnuplot_terminal is eps/quit or png/quit --- src/frontend/plotting/gnuplot.c | 42 +++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/src/frontend/plotting/gnuplot.c b/src/frontend/plotting/gnuplot.c index 5a2c50c28..f6286dbc1 100644 --- a/src/frontend/plotting/gnuplot.c +++ b/src/frontend/plotting/gnuplot.c @@ -223,21 +223,23 @@ ft_gnuplot(double *xlims, double *ylims, char *filename, char *title, char *xlab fprintf(file, "set format y \"%%g\"\n"); fprintf(file, "set format x \"%%g\"\n"); - fprintf(file, "plot "); - i = 0; + if ((terminal_type != 3) && (terminal_type != 5)) { + fprintf(file, "plot "); + i = 0; - /* Write out the gnuplot command */ - for (v = vecs; v; v = v->v_link2) { - scale = v->v_scale; - if (v->v_name) { - i = i + 2; - if (i > 2) fprintf(file, ",\\\n"); - fprintf(file, "\'%s\' using %d:%d with %s lw %d title ", - filename_data, i-1, i, plotstyle, linewidth); - quote_gnuplot_string(file, v->v_name); + /* Write out the gnuplot command */ + for (v = vecs; v; v = v->v_link2) { + scale = v->v_scale; + if (v->v_name) { + i = i + 2; + if (i > 2) fprintf(file, ",\\\n"); + fprintf(file, "\'%s\' using %d:%d with %s lw %d title ", + filename_data, i - 1, i, plotstyle, linewidth); + quote_gnuplot_string(file, v->v_name); + } } + fprintf(file, "\n"); } - fprintf(file, "\n"); /* terminal_type 1: do not print an eps or png file @@ -263,7 +265,21 @@ ft_gnuplot(double *xlims, double *ylims, char *filename, char *title, char *xlab } if ((terminal_type == 3) || (terminal_type == 5)) { - fprintf(file, "replot\n"); + fprintf(file, "plot "); + i = 0; + + /* Write out the gnuplot command */ + for (v = vecs; v; v = v->v_link2) { + scale = v->v_scale; + if (v->v_name) { + i = i + 2; + if (i > 2) fprintf(file, ",\\\n"); + fprintf(file, "\'%s\' using %d:%d with %s lw %d title ", + filename_data, i - 1, i, plotstyle, linewidth); + quote_gnuplot_string(file, v->v_name); + } + } + fprintf(file, "\n"); fprintf(file, "exit\n"); }