enable variable 'nolegend' for gnuplot

This commit is contained in:
Holger Vogt 2021-03-09 23:09:12 +01:00
parent 9a82e5061a
commit 7b9d1fb74a
1 changed files with 11 additions and 1 deletions

View File

@ -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) {