From: trelane@digitasaru.net Date: Mon, 24 Nov 2008 20:56:42 +0000 (-0600) Subject: * lots of goodies. X-Git-Url: http://git.maemo.org/git/?p=scdataviz;a=commitdiff_plain;h=099e099f2dc85d096b0dc73865e4ca94bcc9585c * lots of goodies. --- diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..6f622c7 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,4 @@ +2008-11-15 Johnny Q. Hacker + + * Started the changelog. + diff --git a/Makefile b/Makefile index bdecce4..3922e81 100644 --- a/Makefile +++ b/Makefile @@ -17,8 +17,8 @@ INCL = # List of *.h # Optional add # ################ IPATH = -I. # path of include file -OBJOPT = -ggdb -g3 -Wall -Wstrict-prototypes -DDEBUG -std=c99 -D_GNU_SOURCE # option for obj -EXEOPT = -ggdb -g3 -Wall -Wstrict-prototypes -std=c99 -D_GNU_SOURCE # option for exe (-lefence ...) +OBJOPT = -ggdb -g3 -pg -Wall -Wstrict-prototypes -DDEBUG -std=c99 -D_GNU_SOURCE # option for obj +EXEOPT = -ggdb -g3 -pg -Wall -Wstrict-prototypes -std=c99 -D_GNU_SOURCE # option for exe (-lefence ...) LPATH = -L. # path for librairies ... ##################### diff --git a/graph.c b/graph.c index 891fc6f..cd2b056 100644 --- a/graph.c +++ b/graph.c @@ -185,6 +185,7 @@ struct graph_axis* autoset_axis(Graph* g, GString* title, double min, double max double range_mag; double start_mag; double stop_mag; + int i, j; if(g->points->len == 0) { return NULL; } @@ -207,12 +208,19 @@ struct graph_axis* autoset_axis(Graph* g, GString* title, double min, double max stop_mag = 0; else stop_mag = copysign(pow(10, ceil(log10(max))), max); - if(stop_mag == start_mag) stop_mag *= 10; + for(i=1; i<9; i++) { + if(i*start_mag > min) break; + } + i--; + for(j=10; j>1; j--) { + if(j*(stop_mag/10) < max) break; + } + j++; axis->major=10; axis->minor=1; axis->subminor=4; - axis->major_start=start_mag; - axis->major_step=(stop_mag - start_mag)/(axis->major); + axis->major_start=i*start_mag; + axis->major_step=(j*(stop_mag/10) - axis->major_start)/(axis->major); } axis->title=g_string_new(title->str); #ifdef DEBUG_AUTOAXIS diff --git a/scdataviz.c b/scdataviz.c index a243a98..692f79d 100644 --- a/scdataviz.c +++ b/scdataviz.c @@ -146,7 +146,7 @@ int main(int argc, char *argv[]) struct matdb *mdb = read_matdb_dotcode(file, &err); //fprintf(stderr, "read_matdb_dotcode(%s, %d)=%x", file->str, err, //(int)mdb); - fprintf(stderr, "err=%d\n", err); + //fprintf(stderr, "err=%d\n", err); //print_matdb(mdb); gtk_init (&argc, &argv);