24 void mnbins(
double,
double,
int,
double&,
double&,
int&,
double&);
26 void mnplot(
double* xpt,
double* ypt,
char* chpt,
int nxypt,
int npagwd,
int npagln) {
41 double xmin, ymin, xmax, ymax, savx, savy, yprt;
42 double bwidx, bwidy, xbest, ybest, ax, ay, bx, by;
43 double xvalus[12], any, dxx, dyy;
44 int iten, i, j, k, maxnx, maxny, iquit, ni, linodd;
45 int nxbest, nybest, km1, ibk, isp1, nx, ny, ks, ix;
53 maxnx = npagwd-20 < 100 ? npagwd-20 : 100;
54 if (maxnx < 10) maxnx = 10;
56 if (maxny < 10) maxny = 10;
57 if (nxypt <= 1)
return;
63 for (i = 1; i <= km1; ++i) {
66 for (j = 1; j <= ni; ++j) {
67 if (ypt[j-1] > ypt[j])
continue;
79 if (iquit == 0)
break;
84 for (i = 1; i <= nxypt; ++i) {
85 if (xpt[i-1] > xmax) xmax = xpt[i-1];
86 if (xpt[i-1] < xmin) xmin = xpt[i-1];
88 dxx = (xmax - xmin)*.001;
91 mnbins(xmin, xmax, maxnx, xmin, xmax, nx, bwidx);
94 if (ymax == ymin) ymax = ymin + 1;
95 dyy = (ymax - ymin)*.001;
98 mnbins(ymin, ymax, maxny, ymin, ymax, ny, bwidy);
101 if (chbest ==
' ')
goto L50;
102 xbest = (xmax + xmin)*.5;
103 ybest = (ymax + ymin)*.5;
111 for (i = 1; i <= nxypt; ++i) {
112 xpt[i-1] = ax*xpt[i-1] + bx;
113 ypt[i-1] = any - ay*ypt[i-1] - by;
115 nxbest = int((ax*xbest + bx));
116 nybest = int((any - ay*ybest - by));
123 for (i = 1; i <= ny; ++i) {
124 for (ibk = 1; ibk <= nx; ++ibk) { cline[ibk-1] =
' '; }
129 if (nx>0) cline[nx-1] =
'.';
130 cline[nxbest-1] =
'.';
131 if (i != 1 && i != nybest && i != ny)
goto L320;
132 for (j = 1; j <= nx; ++j) { cline[j-1] =
'.'; }
134 yprt = ymax - double(i-1)*bwidy;
135 if (isp1 > nxypt)
goto L350;
137 for (k = isp1; k <= nxypt; ++k) {
139 if (ks > i)
goto L345;
141 if (cline[ix-1] ==
'.')
goto L340;
142 if (cline[ix-1] ==
' ')
goto L340;
143 if (cline[ix-1] == chpt[k-1])
continue;
150 cline[ix-1] = chpt[k-1];
157 if (linodd == 1 || i == ny)
goto L380;
159 memcpy(ctemp, cline, 120);
160 printf(
" %s",(
const char*)ctemp);
164 memcpy(ctemp, cline, 120);
165 printf(
" %14.7g ..%s",yprt,(
const char*)ctemp);
171 for (ibk = 1; ibk <= nx; ++ibk) {
173 if (ibk % 10 == 1) cline[ibk-1] =
'/';
178 for (ibk = 1; ibk <= 12; ++ibk) {
179 xvalus[ibk-1] = xmin + double(ibk-1)*10*bwidx;
182 iten = (nx + 9) / 10;
183 for (ibk = 1; ibk <= iten; ++ibk) {
184 printf(
" %9.4g", xvalus[ibk-1]);
189 char chmess[] =
" Overprint character is &";
190 printf(
" ONE COLUMN=%13.7g%s",bwidx,(
const char*)chmess);
193 printf(
" ONE COLUMN=%13.7g%s",bwidx,(
const char*)chmess);
Namespace for new ROOT classes and functions.
void mnbins(double a1, double a2, int naa, double &bl, double &bh, int &nb, double &bwid)
void mnplot(double *xpt, double *ypt, char *chpt, int nxypt, int npagwd, int npagln)