ploot

plot images or real-time plain text from a .csv file
Log | Files | Refs | README

commit 0f63680382fb6f810f4ac27df9793db7cba292cc
parent 9bd929c04277a0f9d0056e5b50f1233054a4b17f
Author: Josuah Demangeon <mail@josuah.net>
Date:   Wed,  2 May 2018 16:50:19 +0200

much less evil syntax

Diffstat:
Mffplot.c | 29+++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/ffplot.c b/ffplot.c @@ -239,27 +239,28 @@ find_scales(Vlist *v, int n, dv = *vmax - *vmin; dt = *tmax - *tmin; - for (ts = tscale; ts < tscale + LEN(tscale); ts++) { + for (ts = tscale; ts < tscale + LEN(tscale); ts++) if (dt < *ts * YDENSITY) { *tstep = *ts; break; } - } - if (dv > 1) for (i = 1; i != 0; i *= 10) { - for (vs = vscale; vs < vscale + LEN(vscale); vs++) { - if (dv < *vs * i * XDENSITY) { - *vstep = *vs * i; - return; + if (dv > 1) { + for (i = 1; i != 0; i *= 10) { + for (vs = vscale; vs < vscale + LEN(vscale); vs++) { + if (dv < *vs * i * XDENSITY) { + *vstep = *vs * i; + return; + } } } - } - - for (i = 1; i != 0; i *= 10) { - for (vs = vscale + LEN(vscale) - 1; vs >= vscale; vs--) { - if (dv > *vs / i * XDENSITY / 2) { - *vstep = *vs / i; - return; + } else { + for (i = 1; i != 0; i *= 10) { + for (vs = vscale + LEN(vscale) - 1; vs >= vscale; vs--) { + if (dv > *vs / i * XDENSITY / 2) { + *vstep = *vs / i; + return; + } } } }