Introduction
Introduction Statistics Contact Development Disclaimer Help
much less evil syntax - ploot - simple plotting tools
git clone git://bitreich.org/ploot git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65…
Log
Files
Refs
Tags
README
LICENSE
---
commit 0f63680382fb6f810f4ac27df9793db7cba292cc
parent 9bd929c04277a0f9d0056e5b50f1233054a4b17f
Author: Josuah Demangeon <[email protected]>
Date: Wed, 2 May 2018 16:50:19 +0200
much less evil syntax
Diffstat:
M ffplot.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;
+ }
}
}
}
You are viewing proxied material from bitreich.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.