Browse Source

make flag 'nolegend' localfor each plot

pre-master-46
Holger Vogt 6 years ago
parent
commit
7a7f717574
  1. 7
      src/frontend/plotting/graf.c
  2. 2
      src/include/ngspice/graph.h

7
src/frontend/plotting/graf.c

@ -134,6 +134,8 @@ int gr_init(double *xlims, double *ylims, /* The size of the screen. */
graph->ticdata = NULL; graph->ticdata = NULL;
} }
cp_getvar("nolegend", CP_BOOL, &(graph->nolegend), 0);
if (!xlims || !ylims) { if (!xlims || !ylims) {
internalerror("gr_init: no range specified"); internalerror("gr_init: no range specified");
return FALSE; return FALSE;
@ -184,6 +186,7 @@ int gr_init(double *xlims, double *ylims, /* The size of the screen. */
strcpy(graph->ticchar, pgraph->ticchar); strcpy(graph->ticchar, pgraph->ticchar);
graph->ticdata = pgraph->ticdata; graph->ticdata = pgraph->ticdata;
graph->ticmarks = pgraph->ticmarks; graph->ticmarks = pgraph->ticmarks;
graph->nolegend = pgraph->nolegend;
} }
/* layout decisions */ /* layout decisions */
@ -434,7 +437,7 @@ static void gr_start_internal(struct dvec *dv, bool copyvec)
} }
/* Put the legend entry on the screen. */ /* Put the legend entry on the screen. */
if (!cp_getvar("nolegend", CP_BOOL, NULL, 0))
if (!currentgraph->nolegend)
drawlegend(currentgraph, cur.plotno++, dv); drawlegend(currentgraph, cur.plotno++, dv);
} }
@ -610,7 +613,7 @@ void gr_redraw(GRAPH *graph)
cur.plotno = 0; cur.plotno = 0;
for (link = graph->plotdata; link; link = link->next) { for (link = graph->plotdata; link; link = link->next) {
/* redraw legend */ /* redraw legend */
if (!cp_getvar("nolegend", CP_BOOL, NULL, 0))
if (!graph->nolegend)
drawlegend(graph, cur.plotno++, link->vector); drawlegend(graph, cur.plotno++, link->vector);
/* replot data /* replot data

2
src/include/ngspice/graph.h

@ -33,6 +33,8 @@ struct graph {
int currentcolor; int currentcolor;
int linestyle; int linestyle;
bool nolegend;
struct { struct {
int height, width; int height, width;
} viewport; } viewport;

Loading…
Cancel
Save