40 PLFLT t1, t2, tick_reasonable;
49 pldtfac( vmin, vmax, &factor, NULL );
51 *tick = *tick / factor;
58 t1 = (
PLFLT) log10(
ABS( vmax - vmin ) );
59 np = (
PLINT) floor( t1 );
64 if ( t1 > 0.7781512503 )
69 else if ( t1 > 0.4771212549 )
74 else if ( t1 > 0.1760912591 )
89 tick_reasonable = t2 * pow( 10.0, (
double) np );
92 *tick = t2 * pow( 10.0, (
double) np );
97 if ( *tick < 1.e-4 * tick_reasonable )
99 plexit(
"pldtik: magnitude of specified tick spacing is much too small" );
106 *nsubt =
ABS( *nsubt );
110 *tick = *tick * factor;
134 plbtime( &year, &month, &day, &hour, &min, &sec, vmin );
137 if ( diff < 3.0 * 60.0 )
144 plctime( year, month, day, hour, min, sec, start );
147 else if ( diff < 3.0 * 60.0 * 60.0 )
155 plctime( year, month, day, hour, min, sec, start );
158 else if ( diff < 3.0 * 60.0 * 60.0 * 24.0 )
161 *factor = 60.0 * 60.0;
167 plctime( year, month, day, hour, min, sec, start );
170 else if ( diff < 3.0 * 60.0 * 60.0 * 24.0 * 7.0 )
173 *factor = 60.0 * 60.0 * 24.0;
179 plctime( year, month, day, hour, min, sec, start );
182 else if ( diff < 3.0 * 60.0 * 60.0 * 24.0 * 365 )
185 *factor = 60.0 * 60.0 * 24.0 * 7.0;
191 plctime( year, month, day, hour, min, sec, start );
197 *factor = 60.0 * 60.0 * 24.0 * 365.25;
205 plctime( year, month, day, hour, min, sec, start );
249 #define MIN_FLTDIG 3 // disregarded if fractional part is 0
256 PLFLT chosen, notchosen, vmod, t0;
257 PLINT msd, notmsd, np, digmin, digfix;
270 chosen = (
ABS( vmax ) >=
ABS( vmin ) ) ? vmax : vmin;
271 notchosen = (
ABS( vmax ) >=
ABS( vmin ) ) ? vmin : vmax;
274 if (
ABS( chosen ) > 0. )
276 vmod =
ABS( chosen );
277 t0 = (
PLFLT) log10( vmod );
278 msd = (
PLINT) floor( t0 );
284 t0 = (
PLFLT) log10( vmod );
285 msd = (
PLINT) floor( t0 );
288 if (
ABS( notchosen ) > 0. )
312 if ( chosen < 0. || ( notchosen < 0. && ( notmsd == msd || msd <= 0 ) ) )
315 if ( digmin > digfix && !lf )
324 np = (
PLINT) floor( log10(
ABS( tick ) ) );
329 *prec =
MAX( -np, 0 );
335 if ( *mode == 0 && digmax > 0 && !lf )
339 if ( digmax - 2 - *prec < 0 )
346 *prec =
MAX(
MIN( *prec, digmax - msd - 1 ), 0 );