double range_mag;
double start_mag;
double stop_mag;
+ int i, j;
if(g->points->len == 0) {
return NULL;
}
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