Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

zzaxyy.c

Go to the documentation of this file.
00001 /* zzaxyy.f -- translated by f2c (version 19961017).
00002    You must link the resulting object file with the libraries:
00003         -lf2c -lm   (in that order)
00004 */
00005 
00006 #include "f2c.h"
00007 
00008 /* Common Block Declarations */
00009 
00010 extern struct {
00011     real xpgmin, ypgmin, xpgmax, ypgmax, xclbot, yclbot, xcltop, ycltop, xbot,
00012              ybot, xtop, ytop, xmin, ymin, xmax, ymax;
00013     integer ixcoor, iycoor;
00014     real alphxx, betaxx, alphyy, betayy, tmajx, tminx, tmajy, tminy;
00015     integer majrx, minrx, majry, minry, isizx, isizy;
00016     real xphold, yphold;
00017 } zzzplt_;
00018 
00019 #define zzzplt_1 zzzplt_
00020 
00021 extern struct {
00022     real xphmax, yphmax;
00023     integer ixpmax, iypmax;
00024     real xpscal, ypscal;
00025     integer iflip, nplotr;
00026     char cfile[64];
00027 } zzpltr_;
00028 
00029 #define zzpltr_1 zzpltr_
00030 
00031 /* Table of constant values */
00032 
00033 static integer c__1 = 1;
00034 static integer c__0 = 0;
00035 
00036 
00037 
00038 
00039 /* Subroutine */ int zzaxyy_(real *x, real *y1, real *y2, integer *iside, 
00040         integer *ilab)
00041 {
00042     /* Format strings */
00043     static char fmt_101[] = "(\0021.E\002,i2)";
00044     static char fmt_102[] = "(\0021.E\002,i3)";
00045 
00046     /* System generated locals */
00047     integer i__1, i__2, i__3;
00048     real r__1, r__2;
00049     static char equiv_0[10];
00050 
00051     /* Builtin functions */
00052     integer s_wsfi(icilist *), do_fio(integer *, char *, ftnlen), e_wsfi(void)
00053             ;
00054 
00055     /* Local variables */
00056     static integer ndec, nlab;
00057 #define buf10 (equiv_0)
00058     static real xlab, temp;
00059     static integer nchar;
00060     static real dylab, csize, dycsz;
00061     static integer il;
00062     static real yv, xx, yy;
00063     extern /* Subroutine */ int zzlgin_(real *, real *, integer *);
00064     static integer nl1, nl2, npower, nshift;
00065     extern /* Subroutine */ int zzlabl_(real *, char *, integer *, ftnlen), 
00066             pwritf_(real *, real *, char *, integer *, integer *, integer *, 
00067             integer *, ftnlen), zzlogy_(real *, real *, real *, integer *, 
00068             real *, real *), zzliny_(real *, real *, real *, integer *, real *
00069             , integer *, real *);
00070     static real yv1, yv2, yy1, yy2;
00071     extern /* Subroutine */ int zzphys_(real *, real *);
00072 #define buf (equiv_0)
00073     static real dyv;
00074 
00075     /* Fortran I/O blocks */
00076     static icilist io___23 = { 0, buf10, 0, fmt_101, 10, 1 };
00077     static icilist io___24 = { 0, buf10, 0, fmt_102, 10, 1 };
00078 
00079 
00080 
00081 /*  Draw an axis in the y-direction from (X,Y1) to (X,Y2)  [user coords] 
00082 */
00083 /*  with the specified divisions and tics.  If ISIDE is positive, the */
00084 /*  tic marks appear in the +x direction and the labels in the -x */
00085 /*  direction from the axis.  If ILAB = 0, no labels are drawn. */
00086 /* .......................................................................
00087  */
00088 
00089 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00090  */
00091 
00092 /*  Internal Data for PLOTPAK */
00093 
00094     if (*y1 == *y2) {
00095         goto L8000;
00096     }
00097 
00098     yv1 = dmin(*y1,*y2);
00099     yv2 = dmax(*y1,*y2);
00100 
00101 /*  For log y-axis, must push lower value of Y down and upper value of */
00102 /*  Y up to powers of 10. */
00103 
00104     if (zzzplt_1.iycoor < 0) {
00105         zzlgin_(&yv1, &yv1, &nl1);
00106         temp = yv2;
00107         zzlgin_(&temp, &yv2, &nl2);
00108         if (yv2 <= temp * .999f) {
00109             yv2 *= 10.f;
00110             ++nl2;
00111         }
00112         ndec = nl2 - nl1;
00113         if (ndec <= 0) {
00114             goto L8000;
00115         }
00116     }
00117 /* .......................................................................
00118  */
00119 /*  Convert to physical coordinates and plot axes */
00120 
00121     yy1 = yv1;
00122     yy2 = yv2;
00123     xx = *x;
00124     zzphys_(&temp, &yy1);
00125     zzphys_(&xx, &yy2);
00126 
00127     if (zzzplt_1.iycoor >= 0) {
00128         r__1 = *iside * zzzplt_1.tmajy;
00129         r__2 = *iside * zzzplt_1.tminy;
00130         zzliny_(&xx, &yy1, &yy2, &zzzplt_1.majry, &r__1, &zzzplt_1.minry, &
00131                 r__2);
00132     } else {
00133         r__1 = *iside * zzzplt_1.tmajy;
00134         r__2 = *iside * zzzplt_1.tminy;
00135         zzlogy_(&xx, &yy1, &yy2, &ndec, &r__1, &r__2);
00136     }
00137 /* .......................................................................
00138  */
00139 /*  Plot labels */
00140 
00141     if (*ilab == 0) {
00142         goto L8000;
00143     }
00144 
00145     if (zzzplt_1.iycoor >= 0) {
00146         nlab = zzzplt_1.majry;
00147     } else {
00148         nlab = ndec;
00149     }
00150 
00151 /*  Calculate the max number of characters needed for labels into NSHIFT. 
00152 */
00153 
00154     if (zzzplt_1.iycoor < 0) {
00155 /*  Log-axis:  1.E+x or 1.E+xx are the possibilities */
00156 /* Computing MAX */
00157         i__1 = abs(nl1), i__2 = abs(nl2);
00158         npower = max(i__1,i__2);
00159         if (npower < 10) {
00160             nshift = 5;
00161         } else {
00162             nshift = 6;
00163         }
00164     } else {
00165 /*  Linear-axis:  calculate all labels and find the longest */
00166         nshift = 1;
00167         dyv = (yv2 - yv1) / nlab;
00168         i__1 = nlab;
00169         for (il = 0; il <= i__1; ++il) {
00170             yv = yv1 + il * dyv;
00171 /* Computing MIN */
00172             r__1 = dabs(yv1), r__2 = dabs(yv2);
00173             if (dabs(yv) <= dmin(r__1,r__2) * 1e-5f) {
00174                 yv = 0.f;
00175             }
00176             zzlabl_(&yv, buf, &nchar, 1L);
00177             nshift = max(nshift,nchar);
00178 /* L50: */
00179         }
00180     }
00181 
00182     dylab = (yy2 - yy1) / nlab;
00183     csize = zzzplt_1.isizy * .0011f * (zzzplt_1.xpgmax - zzzplt_1.xpgmin);
00184     xlab = xx - csize * *iside * nshift;
00185     dycsz = csize * .5f;
00186     if (dylab < 0.f) {
00187         dycsz = -dycsz;
00188     }
00189 
00190     i__1 = nlab;
00191     for (il = 0; il <= i__1; ++il) {
00192         if (zzzplt_1.iycoor >= 0) {
00193             yv = yv1 + il * dyv;
00194 /* Computing MIN */
00195             r__1 = dabs(yv1), r__2 = dabs(yv2);
00196             if (dabs(yv) <= dmin(r__1,r__2) * 1e-5f) {
00197                 yv = 0.f;
00198             }
00199             zzlabl_(&yv, buf, &nchar, 1L);
00200         } else {
00201             npower = nl1 + il;
00202             if (abs(npower) < 10) {
00203                 s_wsfi(&io___23);
00204                 do_fio(&c__1, (char *)&npower, (ftnlen)sizeof(integer));
00205                 e_wsfi();
00206                 nchar = 5;
00207             } else {
00208                 s_wsfi(&io___24);
00209                 do_fio(&c__1, (char *)&npower, (ftnlen)sizeof(integer));
00210                 e_wsfi();
00211                 nchar = 6;
00212             }
00213             if (*(unsigned char *)&buf[3] == ' ') {
00214                 *(unsigned char *)&buf[3] = '+';
00215             }
00216         }
00217         if (il == 0) {
00218             yy = yy1 + dycsz;
00219         } else {
00220             yy = yy1 + il * dylab;
00221             if (il == nlab) {
00222                 yy -= dycsz;
00223             }
00224         }
00225         i__2 = -nchar;
00226         i__3 = -(*iside);
00227         pwritf_(&xlab, &yy, buf, &i__2, &zzzplt_1.isizy, &c__0, &i__3, 1L);
00228 /* L100: */
00229     }
00230 /* .......................................................................
00231  */
00232 L8000:
00233     return 0;
00234 } /* zzaxyy_ */
00235 
00236 #undef buf
00237 #undef buf10
00238 
00239 
 

Powered by Plone

This site conforms to the following standards: