diff --git a/src/frontend/plotting/plotcurv.c b/src/frontend/plotting/plotcurv.c index ce11525c9..2c274923a 100644 --- a/src/frontend/plotting/plotcurv.c +++ b/src/frontend/plotting/plotcurv.c @@ -137,6 +137,17 @@ ft_graf(struct dvec *v, struct dvec *xs, bool nostart) realpart(xs->v_compdata[i]); dy = isreal(v) ? v->v_realdata[i] : realpart(v->v_compdata[i]); + /* check for NAN */ + if (isnan(dy)) { + lx = dx; + ly = dy; + continue; + } + else if (!isnan(dy) && isnan(ly)) { + lx = dx; + ly = dy; + } + /* end of check */ if ((i == 0 || (dir > 0 ? lx > dx : dir < 0 ? lx < dx : 0)) && (mono || (xs->v_plot && xs->v_plot->pl_scale == xs))) {