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; |
274 |
|
format = "1e%-3.0f"; |
275 |
|
|
276 |
|
for (pos = xmin; pos < xmax+xstep/2; pos += xstep) { |
277 |
< |
if (flag & XTICS) |
277 |
> |
if (flag & XTICS) { |
278 |
|
if (polar) |
279 |
|
plseg(010, XCONV(pos), yorg-TSIZ/2, XCONV(pos), yorg+TSIZ/2); |
280 |
|
else { |
281 |
|
plseg(010, XCONV(pos), YBEG, XCONV(pos), YBEG-TSIZ); |
282 |
|
plseg(010, XCONV(pos), YBEG+YSIZ-1, XCONV(pos), YBEG+YSIZ-1+TSIZ); |
283 |
|
} |
284 |
+ |
} |
285 |
|
if (flag & XNUMS) { |
286 |
|
sprintf(stemp, format, pos); |
287 |
|
if (polar) |
314 |
|
format = "1e%-3.0f"; |
315 |
|
|
316 |
|
for (pos = ymin; pos < ymax+ystep/2; pos += ystep) { |
317 |
< |
if (flag & YTICS) |
317 |
> |
if (flag & YTICS) { |
318 |
|
if (polar) |
319 |
|
plseg(010, xorg-TSIZ/2, YCONV(pos), xorg+TSIZ/2, YCONV(pos)); |
320 |
|
else { |
321 |
|
plseg(010, XBEG, YCONV(pos), XBEG-TSIZ, YCONV(pos)); |
322 |
|
plseg(010, XBEG+XSIZ-1, YCONV(pos), XBEG+XSIZ-1+TSIZ, YCONV(pos)); |
323 |
|
} |
324 |
+ |
} |
325 |
|
if (flag & YNUMS) { |
326 |
|
sprintf(stemp, format, pos); |
327 |
|
if (polar) |
520 |
|
register char *rval = NULL; |
521 |
|
|
522 |
|
for ( ; *s; s++) |
523 |
< |
if (*s == '"') |
523 |
> |
if (*s == '"') { |
524 |
|
if (rval == NULL) |
525 |
|
rval = s+1; |
526 |
|
else { |
527 |
|
*s = '\0'; |
528 |
|
return(rval); |
529 |
|
} |
530 |
+ |
} |
531 |
|
|
532 |
|
return(NULL); |
533 |
|
} |
557 |
|
if (*yp < ymnset || *yp > ymxset) |
558 |
|
oobounds++; |
559 |
|
|
560 |
< |
if (logx) |
560 |
> |
if (logx) { |
561 |
|
if (*xp < FTINY) |
562 |
|
oobounds++; |
563 |
|
else |
564 |
|
*xp = log10(*xp); |
565 |
+ |
} |
566 |
|
|
567 |
< |
if (logy) |
567 |
> |
if (logy) { |
568 |
|
if (*yp < FTINY) |
569 |
|
oobounds++; |
570 |
|
else |
571 |
|
*yp = log10(*yp); |
572 |
+ |
} |
573 |
|
|
574 |
|
if (polar) { |
575 |
|
a = *xp; |