home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
200-299
/
ff267.lzh
/
Diglib
/
diglib.zoo
/
diglib
/
MAPSML.FOR
< prev
next >
Wrap
Text File
|
1989-06-20
|
8KB
|
290 lines
SUBROUTINE MAPSML(XLOW,XHIGH,YLOW,YHIGH,XLAB,YLAB,TITLE,IAXES)
C
C Cut down version of MAPIT for those users who only need MAPIT to do
C simple things.
C
C The following options have been commented out:
C
C OPTION COMMENT CHARS ADDED LINE CMNT CHARS
C ------ ------------- ---------------------
C GRID LINES CC !!
C LOG AXES CCC !!!
C BOXED PLOT CCCC !!!!
C
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
C
INCLUDE PLTCOM.PRM
INCLUDE PLTSIZ.PRM
INCLUDE PLTCLP.PRM
INCLUDE PLTPRM.PRM
C
EXTERNAL LEN
CHARACTER*1 XLAB(2), YLAB(2), TITLE(2)
CHARACTER*1 NUMBR(14)
LOGICAL*1 LOGXX, LOGYY, LRMTEX, LSHORT, LRAGGD
CCC LOGICAL*1 LOGT
CCC DIMENSION ZLOG(8)
C
CCC DATA ZLOG /0.3010, 0.4771, 0.6021, 0.6990, 0.7782, 0.8451,
CCC 1 0.9031, 0.9542 /
CCC DATA TMINLD /0.1/ !MINIMUM DISTANCE BETWEEN SHORT TICKS (1 MM)
CCC DATA SHORTF /2.0/ !SHORT TICKS = TICKLN/SHORTF
C
C
C SET LOGX AND LOGY TO FALSE FOR OUR USAGE OF SCALE
C
LOGX = .FALSE.
LOGY = .FALSE.
C
C SEE WHAT TYPE OF AXES ARE DESIRED
C
CCC LOGXX = IAND(IAXES,1) .NE. 0
CCC LOGYY = IAND(IAXES,2) .NE. 0
LRAGGD = IAND(IAXES,256) .NE. 0
C
C DO THE AXES SCALING
C
NUMTK = MIN0(10,INT(XVLEN/((ILABSZ()+1.0)*CXSIZE)))
CCC IF (LOGXX) GO TO 20
LSHORT = IAND(IAXES,16) .NE. 0
CALL AXIS(XLOW,XHIGH,NUMTK,LSHORT,LRAGGD,XMIN,XMAX,XTMIN,XTMAX,
1 XTICK,IXPWR)
CCC GO TO 40
CCC20 CALL LAXIS(XLOW,XHIGH,NUMTK,XMIN,XMAX,XTICK)
CCC XTMIN = XMIN
CCC XTMAX = XMAX
CCC IXPWR = 0
CCC40 CONTINUE
NUMTK = MIN0(10,INT(YVLEN/(3.0*CYSIZE)))
CCC IF (LOGYY) GO TO 60
LSHORT = IAND(IAXES,32) .NE. 0
CALL AXIS(YLOW,YHIGH,NUMTK,LSHORT,LRAGGD,YMIN,YMAX,YTMIN,YTMAX,
1 YTICK,IYPWR)
CCC GO TO 80
CCC60 CALL LAXIS(YLOW,YHIGH,NUMTK,YMIN,YMAX,YTICK)
CCC YTMIN = YMIN
CCC YTMAX = YMAX
CCC IYPWR = 0
CCC80 CONTINUE
C
C SET UP TEMPORARY SCALING FACTORS
C
UX0 = XMIN
UDX = XMAX - XMIN
UY0 = YMIN
UDY = YMAX - YMIN
C
C ********** DRAW Y AXES **********
C
CALL GSSETC(CYSIZE,0.0)
CCC LOGT = .FALSE.
CCC IF (.NOT. LOGYY .OR. YTICK .NE. 1.0) GO TO 90
CCC CALL SCALE(XMIN,YMIN,VX,TEMP)
CCC CALL SCALE(XMIN,YMIN+1.0-ZLOG(8),VX,VY)
CCC IF ((VY-TEMP) .GE. TMINLD) LOGT = .TRUE.
CCC90 CONTINUE
C
C DRAW Y AXIS LINE
C
MXLAB = 3
TENEXP = 10.0**IYPWR
X = XMIN
C TICK SPACING
TICKSP = AMAX1(0.0,TICKLN)
CCCC IF (IAND(IAXES,64) .NE. 0) YVLEN = YVLEN - TICKSP
C TICKS TO LEFT FOR LEFT Y AXIS
TCKSGN = -TICKLN
100 CONTINUE
CALL SCALE(X,YMAX,VX,VY)
CALL GSMOVE(VX,VY)
CALL SCALE(X,YMIN,VX,VY)
CALL GSDRAW(VX,VY)
C
C DRAW AND LABEL Y AXIS TICKS
C
Y = YTMIN
N = (YTMAX-YTMIN)/YTICK + 1.1
110 CONTINUE
CALL SCALE(X,Y*TENEXP,VX,VY)
CALL GSMOVE(VX,VY)
CALL GSDRAW(VX+TCKSGN,VY)
CCCC IF (X .EQ. XMAX) GO TO 185
IF (IAND(IAXES,1024) .NE. 0) GO TO 183
C
C PLACE THE APPROPIATE LABEL
C
CCC IF (LOGYY) GO TO 160
CALL LINLAB(INT(Y),IYPWR,NUMBR,LRMTEX)
CCC GO TO 180
CCC160 CALL LOGLAB(INT(Y),NUMBR)
180 LN = LEN(NUMBR)
MXLAB = MAX0(MXLAB,LN)
CALL GSMOVE(VX-TICKSP-CXSIZE*(LN+0.25),VY-CYSIZE/2.0)
CALL GSPSTR(NUMBR)
C
C ADD GRID LINE AT TICK IF DESIRED
C
183 CONTINUE
CC IF (IAND(IAXES,8) .EQ. 0) GO TO 185
CC CALL GSLTYP(3)
CC CALL GSMOVE(VX,VY)
CC CALL SCALE(XMAX,Y*TENEXP,VX,VY)
CC CALL GSDRAW(VX,VY)
CC CALL GSLTYP(1)
185 CONTINUE
C
C DO EXTRA TICKING IF EXTRA TICKS WILL BE FAR ENOUGH APART
C
CCC IF ((.NOT. LOGT) .OR. (Y .EQ. YTMAX)) GO TO 200
CCC DO 190 J = 1, 8
CCC CALL SCALE(X,Y+ZLOG(J),VX,VY)
CCC CALL GSMOVE(VX,VY)
CCC190 CALL GSDRAW(VX+TCKSGN/SHORTF,VY)
200 CONTINUE
Y = Y + YTICK
N = N-1
IF (N .GT. 0) GO TO 110
CCCC IF (X .EQ. XMAX) GO TO 300
C
C IF LINEAR AXIS, PLACE REMOTE EXPONENT IF NEEDED
C
CCC IF (LOGYY .OR. (.NOT. LRMTEX)) GO TO 260
C !!!INSTEAD OF PREVIOUS LINE
IF (.NOT. LRMTEX) GO TO 260
C
IF (IAND(IAXES,1024) .NE. 0) GO TO 260
CALL SCALE(XMIN,(YTMIN+YTICK/2.0)*TENEXP,VX,VY)
CALL SCOPY('E',NUMBR)
CALL NUMSTR(IYPWR,NUMBR(2))
CALL GSMOVE(VX-CXSIZE*(LEN(NUMBR)+0.5),VY-CYSIZE/2.0)
CALL GSPSTR(NUMBR)
C
C NOW PLACE Y LABLE
C
260 CALL SCALE(XMIN,(YMIN+YMAX)/2.0,VX,VY)
CALL GSMOVE(VX-(MXLAB+0.25)*CXSIZE-TICKSP-CYSIZE,
1 VY-CXSIZE*LEN(YLAB)/2.0)
CALL GSSETC(CYSIZE,90.0)
CALL GSPSTR(YLAB)
CALL GSSETC(CYSIZE,0.0)
CCCC IF (IAND(IAXES,128) .EQ. 0) GO TO 300
CCCC X = XMAX
CCCC TCKSGN = TICKLN
CCCC GO TO 100
300 CONTINUE
C
C ********** DRAW X AXIS **********
C
CCC LOGT = .FALSE.
CCC IF (.NOT. LOGXX .OR. XTICK .NE. 1.0) GO TO 310
CCC CALL SCALE(XMIN,YMIN,TEMP,VY)
CCC CALL SCALE(XMIN+1.0-ZLOG(8),YMIN,VX,VY)
CCC IF ((VX-TEMP) .GE. TMINLD) LOGT = .TRUE.
CCC310 CONTINUE
C
C DRAW X AXIS LINE
C
Y = YMIN
TCKSGN = -TICKLN
TENEXP = 10.0**IXPWR
C TICK SPACING
TICKSP = AMAX1(0.5*CYSIZE,TICKLN)
320 CONTINUE
CALL SCALE(XMIN,Y,VX,VY)
CALL GSMOVE(VX,VY)
CALL SCALE(XMAX,Y,VX,VY)
CALL GSDRAW(VX,VY)
C
C DRAW AND LABEL X AXIS TICKS
C
X = XTMIN
N = (XTMAX-XTMIN)/XTICK + 1.1
400 CONTINUE
CALL SCALE(X*TENEXP,Y,VX,VY)
CALL GSMOVE(VX,VY)
CALL GSDRAW(VX,VY+TCKSGN)
CCCC IF (Y .EQ. YMAX) GO TO 430
IF (IAND(IAXES,512) .NE. 0) GO TO 423
CCC IF (LOGXX) GO TO 410
CALL LINLAB(INT(X),IXPWR,NUMBR,LRMTEX)
CCC GO TO 420
CCC410 CALL LOGLAB(INT(X),NUMBR)
420 CALL GSMOVE(VX-CXSIZE*LEN(NUMBR)/2.0,VY-TICKSP-1.5*CYSIZE)
CALL GSPSTR(NUMBR)
C
C ADD GRID LINE AT TICK IF DESIRED
C
423 CONTINUE
CC IF (IAND(IAXES,4) .EQ. 0) GO TO 430
CC CALL GSLTYP(3)
CC CALL GSMOVE(VX,VY)
CC CALL SCALE(X*TENEXP,YMAX,VX,VY)
CC CALL GSDRAW(VX,VY)
CC CALL GSLTYP(1)
CC430 CONTINUE
C
C DO EXTRA TICKING IF EXTRA TICKS WILL BE FAR ENOUGH APART
C
CCC IF ((.NOT. LOGT) .OR. (X .EQ. XTMAX)) GO TO 490
CCC DO 450 J = 1, 8
CCC CALL SCALE(X+ZLOG(J),Y,VX,VY)
CCC CALL GSMOVE(VX,VY)
CCC CALL GSDRAW(VX,VY+TCKSGN/SHORTF)
CCC450 CONTINUE
CCC490 CONTINUE
X = X + XTICK
N = N-1
IF (N .GT. 0) GO TO 400
CCCC IF (Y .EQ. YMAX) GO TO 590
C
C NOW PLACE REMOTE EXPONENT IF NEEDED ON LINEAR AXIS
C
CCC IF (LOGXX .OR. (.NOT. LRMTEX)) GO TO 520
C !!!INSTEAD OF PREVIOUS LINE
IF (.NOT. LRMTEX) GO TO 520
C
IF (IAND(IAXES,512) .NE. 0) GO TO 520
CALL SCALE(XMIN,YMIN,VX,VY)
CALL SCOPY('E',NUMBR)
CALL NUMSTR(IXPWR,NUMBR(2))
CALL GSMOVE(VX+3*CXSIZE,VY-TICKSP-2.75*CYSIZE)
CALL GSPSTR(NUMBR)
C
C NOW PLACE X AXIS LABLE
C
520 CALL SCALE((XMIN+XMAX)/2.0,YMIN,VX,VY)
CALL GSMOVE(VX-CXSIZE*LEN(XLAB)/2.0,VY-TICKSP-4.0*CYSIZE)
CALL GSPSTR(XLAB)
CCCC IF (IAND(IAXES,64) .EQ. 0) GO TO 590
CCCC Y = YMAX
CCCC TCKSGN = TICKLN
CCCC GO TO 320
CCCC590 CONTINUE
C
C ********** PLACE TITLE **********
C
CALL SCALE((XMIN+XMAX)/2.0,YMAX,VX,VY)
TCKSGN = 0.0
CCCC IF (IAND(IAXES,64) .NE. 0) TCKSGN = TICKSP
CALL GSMOVE(VX-CXSIZE*LEN(TITLE)/2.0,VY+TCKSGN+CYSIZE)
CALL GSPSTR(TITLE)
C
C MAKE SURE "PLTCLP" CONTAINS LIMITS PICKED BY MAPIT. ONLY MAINTAINED
C FOR CALLERS INFO.
C
CCC IF (.NOT. LOGXX) GO TO 610
CCC XMIN = 10.0**XMIN
CCC XMAX = 10.0**XMAX
CCC610 CONTINUE
CCC IF (.NOT. LOGYY) GO TO 620
CCC YMIN = 10.0**YMIN
CCC YMAX = 10.0**YMAX
CCC620 CONTINUE
C
C TELL SCALE ABOUT LOG AXIS SCALING NOW
C
CCC LOGX = LOGXX
CCC LOGY = LOGYY
RETURN
END