- u = round_up (upper, 5);
- l = round_down (lower, 5);
- nbars = (u - l) / 5;
- if (nbars * 2 + 1 <= MAX_HIST_BARS)
- {
- nbars *= 2;
- u = round_up (upper, 2.5);
- l = round_down (lower, 2.5);
- if (l + 1.25 <= lower && u - 1.25 >= upper)
- nbars--, lower = l + 1.25, upper = u - 1.25;
- else if (l + 1.25 <= lower)
- lower = l + 1.25, upper = u + 1.25;
- else if (u - 1.25 >= upper)
- lower = l - 1.25, upper = u - 1.25;
- else
- nbars++, lower = l - 1.25, upper = u + 1.25;
- }
- else if (nbars < MAX_HIST_BARS)
- {
- if (l + 2.5 <= lower && u - 2.5 >= upper)
- nbars--, lower = l + 2.5, upper = u - 2.5;
- else if (l + 2.5 <= lower)
- lower = l + 2.5, upper = u + 2.5;
- else if (u - 2.5 >= upper)
- lower = l - 2.5, upper = u - 2.5;
- else
- nbars++, lower = l - 2.5, upper = u + 2.5;
- }
- else
- nbars = MAX_HIST_BARS;
- }
- else
- {
- nbars = avlcount (cur_var->p.frq.t.f);
- if (nbars > MAX_HIST_BARS)
- nbars = MAX_HIST_BARS;
- }
- if (nbars < MIN_HIST_BARS)
- nbars = MIN_HIST_BARS;
- interval = (upper - lower) / nbars;