5 #include "Dimensions.h"
14 * Return the maximum combined height that all the sample
15 * curves will reach. This (absolute) figure can then be
16 * used to scale the samples automatically so that they
31 maxima = (floatish*) xmalloc(nsamples * sizeof(floatish));
32 for (i = 0; i < nsamples; i++) {
36 for (i = 0; i < nidents; i++) {
37 for (ch = identtable[i]->chk; ch; ch = ch->next) {
38 for (j = 0; j < ch->nd; j++) {
39 bucket = ch->d[j].bucket;
40 value = ch->d[j].value;
41 if (bucket >= nsamples)
42 Disaster("bucket out of range");
43 maxima[ bucket ] += value;
48 for (mx = maxima[ 0 ], i = 0; i < nsamples; i++) {
49 if (maxima[ i ] > mx) mx = maxima[ i ];
59 * Scale the values from the samples so that they will fit on
63 extern floatish xrange;
64 extern floatish yrange;
74 if (yrange == 0.0) /* no samples */
77 sf = graphheight / yrange;
79 for (i = 0; i < nidents; i++) {
80 for (ch = identtable[i]->chk; ch; ch = ch->next) {
81 for (j = 0; j < ch->nd; j++) {
82 ch->d[j].value = ch->d[j].value * sf;