diff --git a/src/frontend/plotting/graf.c b/src/frontend/plotting/graf.c index 6f4fde3b0..3d069b350 100644 --- a/src/frontend/plotting/graf.c +++ b/src/frontend/plotting/graf.c @@ -267,7 +267,7 @@ gr_point(struct dvec *dv, switch (currentgraph->plottype) { double *tics; case PLOT_LIN: - + case PLOT_MONOLIN: /* If it's a linear plot, ignore first point since we don't want to connect with oldx and oldy. */ if (np) diff --git a/src/frontend/plotting/plotcurv.c b/src/frontend/plotting/plotcurv.c index f8cea7b4f..ce11525c9 100644 --- a/src/frontend/plotting/plotcurv.c +++ b/src/frontend/plotting/plotcurv.c @@ -130,6 +130,7 @@ ft_graf(struct dvec *v, struct dvec *xs, bool nostart) * interpolation. */ if ((degree == 1) && (gridsize == 0)) { + bool mono = (currentgraph->plottype == PLOT_MONOLIN); dir = 0; for (i = 0, j = v->v_length; i < j; i++) { dx = isreal(xs) ? xs->v_realdata[i] : @@ -137,7 +138,7 @@ ft_graf(struct dvec *v, struct dvec *xs, bool nostart) dy = isreal(v) ? v->v_realdata[i] : realpart(v->v_compdata[i]); if ((i == 0 || (dir > 0 ? lx > dx : dir < 0 ? lx < dx : 0)) && - xs->v_plot && xs->v_plot->pl_scale == xs) + (mono || (xs->v_plot && xs->v_plot->pl_scale == xs))) { gr_point(v, dx, dy, lx, ly, 0); } else { diff --git a/src/frontend/plotting/plotit.c b/src/frontend/plotting/plotit.c index 8e9035723..1f576cc2f 100644 --- a/src/frontend/plotting/plotit.c +++ b/src/frontend/plotting/plotit.c @@ -454,6 +454,14 @@ plotit(wordlist *wl, char *hcopy, char *devname) pfound = TRUE; } } + if (getflag(wl, "noretraceplot")) { + if (pfound) { + fprintf(cp_err, "Warning: too many plot types given\n"); + } else { + ptype = PLOT_MONOLIN; + pfound = TRUE; + } + } if (getflag(wl, "combplot")) { if (pfound) { fprintf(cp_err, "Warning: too many plot types given\n"); @@ -475,6 +483,8 @@ plotit(wordlist *wl, char *hcopy, char *devname) if (cp_getvar("plotstyle", CP_STRING, buf)) { if (eq(buf, "linplot")) ptype = PLOT_LIN; + else if (eq(buf, "noretraceplot")) + ptype = PLOT_MONOLIN; else if (eq(buf, "combplot")) ptype = PLOT_COMB; else if (eq(buf, "pointplot")) diff --git a/src/include/ngspice/dvec.h b/src/include/ngspice/dvec.h index 77eb6f179..7c040c7f4 100644 --- a/src/include/ngspice/dvec.h +++ b/src/include/ngspice/dvec.h @@ -20,7 +20,7 @@ enum dvec_flags { /* Plot types. */ typedef enum { - PLOT_LIN, PLOT_COMB, PLOT_POINT + PLOT_LIN, PLOT_COMB, PLOT_POINT, PLOT_MONOLIN } PLOTTYPE;