48 |
|
short userror = 0; |
49 |
|
int i; |
50 |
|
|
51 |
< |
if (s[0] == '-') |
51 |
> |
if (s[0] == '-') { |
52 |
|
|
53 |
|
switch(s[1]) { |
54 |
|
|
92 |
|
userror = *sp; |
93 |
|
break; |
94 |
|
} |
95 |
< |
else |
95 |
> |
} else { |
96 |
|
|
97 |
|
switch (s[1]) { |
98 |
|
|
111 |
|
usecurve[*sp-'@'] = 1; |
112 |
|
userror = *sp; |
113 |
|
} |
114 |
+ |
} |
115 |
|
|
116 |
|
if (userror) |
117 |
|
error(USER, "options are [-sSYMRAD][-g][-lx][-ly][-p{dr}][-xXMIN][+xXMAX][-yYMIN][+yYMAX][-C..|+C..]"); |
182 |
|
char *format, stemp[32]; |
183 |
|
|
184 |
|
/* set limits */ |
185 |
< |
if (polar) |
185 |
> |
if (polar) { |
186 |
|
if (xmax-xmin < ymax-ymin) /* null aspect for polar */ |
187 |
|
xmax = xmin + ymax-ymin; |
188 |
|
else |
189 |
|
ymax = ymin + xmax-xmin; |
190 |
< |
else { |
191 |
< |
if (xmnset > -FHUGE) |
190 |
> |
} else { |
191 |
> |
if (xmnset > -FHUGE) { |
192 |
|
if (logx) { |
193 |
|
if (xmnset > FTINY) |
194 |
|
xmin = log10(xmnset); |
195 |
< |
} |
195 |
< |
else |
195 |
> |
} else |
196 |
|
xmin = xmnset; |
197 |
< |
if (xmxset < FHUGE) |
197 |
> |
} |
198 |
> |
if (xmxset < FHUGE) { |
199 |
|
if (logx) { |
200 |
|
if (xmxset > FTINY) |
201 |
|
xmax = log10(xmxset); |
202 |
< |
} |
202 |
< |
else |
202 |
> |
} else |
203 |
|
xmax = xmxset; |
204 |
< |
if (ymnset > -FHUGE) |
204 |
> |
} |
205 |
> |
if (ymnset > -FHUGE) { |
206 |
|
if (logy) { |
207 |
|
if (ymnset > FTINY) |
208 |
|
ymin = log10(ymnset); |
209 |
< |
} |
209 |
< |
else |
209 |
> |
} else |
210 |
|
ymin = ymnset; |
211 |
< |
if (ymxset < FHUGE) |
211 |
> |
} |
212 |
> |
if (ymxset < FHUGE) { |
213 |
|
if (logy) { |
214 |
|
if (ymxset > FTINY) |
215 |
|
ymax = log10(ymxset); |
216 |
< |
} |
216 |
< |
else |
216 |
> |
} else |
217 |
|
ymax = ymxset; |
218 |
+ |
} |
219 |
|
} |
220 |
|
/* set step */ |
221 |
|
if (logx) { |
235 |
|
xsize = xmax - xmin; |
236 |
|
ysize = ymax - ymin; |
237 |
|
|
238 |
< |
if (polar) /* null aspect again */ |
238 |
> |
if (polar) { /* null aspect again */ |
239 |
|
if (xsize < ysize) |
240 |
|
xmax = xmin + (xsize = ysize); |
241 |
|
else |
242 |
|
ymax = ymin + (ysize = xsize); |
243 |
+ |
} |
244 |
|
|
245 |
|
if (xmin > 0.0) |
246 |
|
xorg = XBEG; |
262 |
|
if (flag & ORIGIN) |
263 |
|
plseg(010, XBEG, yorg, XBEG+XSIZ-1, yorg); |
264 |
|
|
263 |
– |
#if CPM || MAC |
264 |
– |
if (xstep > 1.0) |
265 |
– |
format = "%5.0f"; |
266 |
– |
else |
267 |
– |
format = "%5.3f"; |
268 |
– |
#else |
265 |
|
format = "%5g"; |
270 |
– |
#endif |
266 |
|
if (logx) |
267 |
|
format = "1e%-3.0f"; |
268 |
|
|
269 |
|
for (pos = xmin; pos < xmax+xstep/2; pos += xstep) { |
270 |
< |
if (flag & XTICS) |
270 |
> |
if (flag & XTICS) { |
271 |
|
if (polar) |
272 |
|
plseg(010, XCONV(pos), yorg-TSIZ/2, XCONV(pos), yorg+TSIZ/2); |
273 |
|
else { |
274 |
|
plseg(010, XCONV(pos), YBEG, XCONV(pos), YBEG-TSIZ); |
275 |
|
plseg(010, XCONV(pos), YBEG+YSIZ-1, XCONV(pos), YBEG+YSIZ-1+TSIZ); |
276 |
|
} |
277 |
+ |
} |
278 |
|
if (flag & XNUMS) { |
279 |
|
sprintf(stemp, format, pos); |
280 |
|
if (polar) |
295 |
|
if (flag & ORIGIN) |
296 |
|
plseg(010, xorg, YBEG, xorg, YBEG+YSIZ-1); |
297 |
|
|
302 |
– |
#if CPM || MAC |
303 |
– |
if (ystep > 1.0) |
304 |
– |
format = "%5.0f"; |
305 |
– |
else |
306 |
– |
format = "%5.3f"; |
307 |
– |
#else |
298 |
|
format = "%5g"; |
309 |
– |
#endif |
299 |
|
if (logy) |
300 |
|
format = "1e%-3.0f"; |
301 |
|
|
302 |
|
for (pos = ymin; pos < ymax+ystep/2; pos += ystep) { |
303 |
< |
if (flag & YTICS) |
303 |
> |
if (flag & YTICS) { |
304 |
|
if (polar) |
305 |
|
plseg(010, xorg-TSIZ/2, YCONV(pos), xorg+TSIZ/2, YCONV(pos)); |
306 |
|
else { |
307 |
|
plseg(010, XBEG, YCONV(pos), XBEG-TSIZ, YCONV(pos)); |
308 |
|
plseg(010, XBEG+XSIZ-1, YCONV(pos), XBEG+XSIZ-1+TSIZ, YCONV(pos)); |
309 |
|
} |
310 |
+ |
} |
311 |
|
if (flag & YNUMS) { |
312 |
|
sprintf(stemp, format, pos); |
313 |
|
if (polar) |
506 |
|
register char *rval = NULL; |
507 |
|
|
508 |
|
for ( ; *s; s++) |
509 |
< |
if (*s == '"') |
509 |
> |
if (*s == '"') { |
510 |
|
if (rval == NULL) |
511 |
|
rval = s+1; |
512 |
|
else { |
513 |
|
*s = '\0'; |
514 |
|
return(rval); |
515 |
|
} |
516 |
+ |
} |
517 |
|
|
518 |
|
return(NULL); |
519 |
|
} |
543 |
|
if (*yp < ymnset || *yp > ymxset) |
544 |
|
oobounds++; |
545 |
|
|
546 |
< |
if (logx) |
546 |
> |
if (logx) { |
547 |
|
if (*xp < FTINY) |
548 |
|
oobounds++; |
549 |
|
else |
550 |
|
*xp = log10(*xp); |
551 |
+ |
} |
552 |
|
|
553 |
< |
if (logy) |
553 |
> |
if (logy) { |
554 |
|
if (*yp < FTINY) |
555 |
|
oobounds++; |
556 |
|
else |
557 |
|
*yp = log10(*yp); |
558 |
+ |
} |
559 |
|
|
560 |
|
if (polar) { |
561 |
|
a = *xp; |