diff --git a/src/frontend/plotting/graf.c b/src/frontend/plotting/graf.c index 6342babf9..648ba104b 100644 --- a/src/frontend/plotting/graf.c +++ b/src/frontend/plotting/graf.c @@ -135,6 +135,7 @@ int gr_init(double *xlims, double *ylims, /* The size of the screen. */ } cp_getvar("nolegend", CP_BOOL, &(graph->nolegend), 0); + cp_getvar("nounits", CP_BOOL, &(graph->nounits), 0); if (!xlims || !ylims) { internalerror("gr_init: no range specified"); diff --git a/src/frontend/plotting/grid.c b/src/frontend/plotting/grid.c index f76c55280..4ef20cce4 100644 --- a/src/frontend/plotting/grid.c +++ b/src/frontend/plotting/grid.c @@ -737,11 +737,13 @@ drawlingrid(GRAPH *graph, char *units, int spacing, int nsp, double dst, double if (nsp == 1) j += 1000; } - if (axis == x_axis) - DevDrawText(units, (int) (graph->absolute.width * RELPOSXUNIT + unitshift), graph->fontheight, 0); - else - DevDrawText(units, graph->fontwidth, - (int) (graph->absolute.height - 2 * graph->fontheight), 0); + if (!graph->nounits) { + if (axis == x_axis) + DevDrawText(units, (int)(graph->absolute.width * RELPOSXUNIT + unitshift), graph->fontheight, 0); + else + DevDrawText(units, graph->fontwidth, + (int)(graph->absolute.height - 2 * graph->fontheight), 0); + } DevUpdate(); } @@ -943,12 +945,14 @@ drawloggrid(GRAPH *graph, char *units, int hmt, int lmt, int decsp, int subs, in } } - if (axis == x_axis) - DevDrawText(units, (int) (graph->absolute.width * RELPOSXUNIT + unitshift), - graph->fontheight, 0); - else - DevDrawText(units, graph->fontwidth, - (int) (graph->absolute.height - 2 * graph->fontheight), 0); + if (!graph->nounits) { + if (axis == x_axis) + DevDrawText(units, (int)(graph->absolute.width * RELPOSXUNIT + unitshift), + +graph->fontheight, 0); + else + DevDrawText(units, graph->fontwidth, + (int)(graph->absolute.height - 2 * graph->fontheight), 0); + } DevUpdate(); } diff --git a/src/include/ngspice/graph.h b/src/include/ngspice/graph.h index 22dbeb9d8..b52ef5b4c 100644 --- a/src/include/ngspice/graph.h +++ b/src/include/ngspice/graph.h @@ -33,7 +33,7 @@ struct graph { int currentcolor; int linestyle; - bool nolegend; + bool nolegend, nounits; struct { int height, width;