Commit 64722eb1 authored by Vesa Oikonen's avatar Vesa Oikonen
Browse files

less x axis ticks when scale is small or large

parent 9dbc1b09
......@@ -382,6 +382,8 @@ int svg_calculate_axes(
if(vp->x.fixed_max) vp->x.max=orig_max;
if(verbose>1) printf("x-range %g - %g -> %g - %g\n", orig_min, orig_max, vp->x.min, vp->x.max);
vp->x.tick_nr=MAX_TICK_NR;
if((fabs(vp->x.max)<0.1 || fabs(vp->x.max)>10000) && vp->x.tick_nr>8) vp->x.tick_nr=8; // Only few long tick labels can fit on x axis
if((fabs(vp->x.max)<0.01 || fabs(vp->x.max)>100000) && vp->x.tick_nr>6) vp->x.tick_nr=5; // even fewer tick labels can fit on x axis
if(vp->label_area_viewport.is) vp->x.tick_nr=1+vp->x.tick_nr/2; // Legends reduce the width of x axis
ret=axis_tick_positions(
vp->x.min, vp->x.max, vp->x.tick, &vp->x.tick_nr, &vp->x.tickscale,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment