new variable nolegend: with 'set nolegend' plotting of

the legend is suppressed.
This commit is contained in:
Holger Vogt 2020-02-07 23:17:24 +01:00
parent 7d9062f1f9
commit 9f73552d29
2 changed files with 7 additions and 4 deletions

View File

@ -18,6 +18,8 @@ setcs xfont='Noto Sans CJK JP Medium'
set gridwidth=4
set xbrushwidth=1
set nolegend
*hardcopy
**plot y vs x xlabel 'Labellisé X' ylabel 'Labellisé Y: ÜüÖöÄäÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ' title 'Titré'

View File

@ -423,9 +423,9 @@ static void gr_start_internal(struct dvec *dv, bool copyvec)
/* Put the legend entry on the screen. */
drawlegend(currentgraph, cur.plotno++, dv);
} /* end of function gr_start_internal */
if (!cp_getvar("nolegend", CP_BOOL, NULL, 0))
drawlegend(currentgraph, cur.plotno++, dv);
}
/* Start one plot of a graph */
@ -599,7 +599,8 @@ void gr_redraw(GRAPH *graph)
cur.plotno = 0;
for (link = graph->plotdata; link; link = link->next) {
/* redraw legend */
drawlegend(graph, cur.plotno++, link->vector);
if (!cp_getvar("nolegend", CP_BOOL, NULL, 0))
drawlegend(graph, cur.plotno++, link->vector);
/* replot data
if onevalue, pass it a NULL scale