From c43c6f6ca4b569d9665bb25822ae60392d34682e Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 29 Nov 2020 16:28:51 +0100 Subject: [PATCH] improve comment --- src/frontend/plotting/plotcurv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/frontend/plotting/plotcurv.c b/src/frontend/plotting/plotcurv.c index da7026adb..892b3de92 100644 --- a/src/frontend/plotting/plotcurv.c +++ b/src/frontend/plotting/plotcurv.c @@ -130,6 +130,10 @@ ft_graf(struct dvec *v, struct dvec *xs, bool nostart) * interpolation. */ if ((degree == 1) && (gridsize == 0)) { + /* We have to take care of non-monotonic x-axis values. + If they occur, plotting is suppressed, except for mono is set + to FALSE by flag 'retraceplot' in command 'plot'. + Then everything is plotted. */ bool mono = (currentgraph->plottype != PLOT_RETLIN); dir = 0; for (i = 0, j = v->v_length; i < j; i++) { @@ -137,7 +141,7 @@ 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]); - if ((i == 0 || (dir > 0 ? lx > dx : dir < 0 ? lx < dx : 0)) && + if ((i == 0 || (dir > 0 ? lx > dx : (dir < 0 ? lx < dx : 0))) && (mono || (xs->v_plot && xs->v_plot->pl_scale == xs))) { gr_point(v, dx, dy, lx, ly, 0);