Browse Source

avoid retrace in output graph by adding label 'noretraceplot'

to the plot command, that creates a lin plot trying to avoid retracing
pre-master-46
h_vogt 10 years ago
committed by Holger Vogt
parent
commit
d4adb027d2
  1. 2
      src/frontend/plotting/graf.c
  2. 3
      src/frontend/plotting/plotcurv.c
  3. 10
      src/frontend/plotting/plotit.c
  4. 2
      src/include/ngspice/dvec.h

2
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)

3
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 {

10
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"))

2
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;

Loading…
Cancel
Save