plotcurv.c, improve simple plot by checking for NAN

This commit is contained in:
h_vogt 2017-04-29 21:50:41 +02:00
parent e2b541086c
commit 3f96807632
1 changed files with 11 additions and 0 deletions

View File

@ -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)))
{