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