enable variable 'nolegend' for gnuplot
This commit is contained in:
parent
9a82e5061a
commit
7b9d1fb74a
|
|
@ -61,7 +61,7 @@ void ft_gnuplot(double *xlims, double *ylims,
|
||||||
struct dvec *v, *scale = NULL;
|
struct dvec *v, *scale = NULL;
|
||||||
double xval, yval, prev_xval, extrange;
|
double xval, yval, prev_xval, extrange;
|
||||||
int i, dir, numVecs, linewidth, gridlinewidth, err, terminal_type;
|
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 buf[BSIZE_SP], pointstyle[BSIZE_SP], *text, plotstyle[BSIZE_SP], terminal[BSIZE_SP];
|
||||||
|
|
||||||
char filename_data[128];
|
char filename_data[128];
|
||||||
|
|
@ -138,6 +138,13 @@ void ft_gnuplot(double *xlims, double *ylims,
|
||||||
markers = FALSE;
|
markers = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!cp_getvar("nolegend", CP_BOOL, NULL, 0)) {
|
||||||
|
nolegend = FALSE;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
nolegend = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Make sure the gridtype is supported. */
|
/* Make sure the gridtype is supported. */
|
||||||
switch (gridtype) {
|
switch (gridtype) {
|
||||||
case GRID_LIN:
|
case GRID_LIN:
|
||||||
|
|
@ -249,6 +256,9 @@ void ft_gnuplot(double *xlims, double *ylims,
|
||||||
if (gridlinewidth > 1)
|
if (gridlinewidth > 1)
|
||||||
fprintf(file, "set border lw %d\n", gridlinewidth);
|
fprintf(file, "set border lw %d\n", gridlinewidth);
|
||||||
|
|
||||||
|
if(nolegend)
|
||||||
|
fprintf(file, "set key off\n");
|
||||||
|
|
||||||
if (plottype == PLOT_COMB) {
|
if (plottype == PLOT_COMB) {
|
||||||
strcpy(plotstyle, "boxes");
|
strcpy(plotstyle, "boxes");
|
||||||
} else if (plottype == PLOT_POINT) {
|
} else if (plottype == PLOT_POINT) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue