diff --git a/src/frontend/plotting/grid.c b/src/frontend/plotting/grid.c index 91638f0ac..0d1a21371 100644 --- a/src/frontend/plotting/grid.c +++ b/src/frontend/plotting/grid.c @@ -389,6 +389,9 @@ lingrid(GRAPH *graph, double lo, double hi, double delta, int type, Axis axis) if (dst > div_list[i].div_lim) break; + if ((size_t) i == NUMELEMS(div_list)) + i--; + do { step = div_list[i].step; nsp = (int)((dst + step - 0.0001) / step);