/** * Constructs axis tics for a specified major tic interval. * @param x1 the value at one end of the axis. * @param x2 the value at the other end of the axis. * @param dtic the major tic interval; a positive number. */ public AxisTics(double x1, double x2, double dtic) { double xmin = min(x1,x2); double xmax = max(x1,x2); xmin -= (xmax-xmin)*FLT_EPSILON; xmax += (xmax-xmin)*FLT_EPSILON; double d = abs(dtic); double f = ceil(xmin/d)*d; //double f = ((int)(xmin/d)-1)*d; //while (f<xmin) // f += d; int n = 1+(int)((xmax-f)/d); _xmin = xmin; _xmax = xmax; _ntic = n; _dtic = d; _ftic = f; computeMultiple(); computeMinorTics(); }
_mtic = mbest; computeMinorTics();