diff --git a/src/frontend/plotting/gnuplot.c b/src/frontend/plotting/gnuplot.c index ca8e192c4..c43a3883f 100644 --- a/src/frontend/plotting/gnuplot.c +++ b/src/frontend/plotting/gnuplot.c @@ -61,7 +61,7 @@ void ft_gnuplot(double *xlims, double *ylims, struct dvec *v, *scale = NULL; double xval, yval, prev_xval, extrange; int i, dir, numVecs, linewidth, gridlinewidth, err, terminal_type; - bool xlog, ylog, nogrid, markers; + bool xlog, ylog, nogrid, markers, nolegend; char buf[BSIZE_SP], pointstyle[BSIZE_SP], *text, plotstyle[BSIZE_SP], terminal[BSIZE_SP]; char filename_data[128]; @@ -138,6 +138,13 @@ void ft_gnuplot(double *xlims, double *ylims, markers = FALSE; } + if (!cp_getvar("nolegend", CP_BOOL, NULL, 0)) { + nolegend = FALSE; + } + else { + nolegend = TRUE; + } + /* Make sure the gridtype is supported. */ switch (gridtype) { case GRID_LIN: @@ -249,6 +256,9 @@ void ft_gnuplot(double *xlims, double *ylims, if (gridlinewidth > 1) fprintf(file, "set border lw %d\n", gridlinewidth); + if(nolegend) + fprintf(file, "set key off\n"); + if (plottype == PLOT_COMB) { strcpy(plotstyle, "boxes"); } else if (plottype == PLOT_POINT) {