00001
00002 c
00003 c Copyright (c) 1986,1987,1988,1989,1990,1991,1992,1993,
00004 c by Steve McMillan, Drexel University, Philadelphia, PA.
00005 c
00006 c All rights reserved.
00007 c
00008 c Redistribution and use in source and binary forms are permitted
00009 c provided that the above copyright notice and this paragraph are
00010 c duplicated in all such forms and that any documentation,
00011 c advertising materials, and other materials related to such
00012 c distribution and use acknowledge that the software was developed
00013 c by the author named above.
00014 c
00015 c THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
00016 c IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
00017 c WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00018 c
00019 subroutine mline(xarray,yarray,n,jth,jsymbl,htsym)
00020 save
00021 c
00022 c Plots the n points yarray(xarray), with identifying
00023 c symbols, of height |htsym|, at every |jth|-th point
00024 c for nonzero jth.
00025 c
00026 c if jth = 0, the points are joined by solid lines only.
00027 c if jth > 0, both lines and symbols are drawn.
00028 c if jth < 0, only the symbols are drawn.
00029 c
00030 c If jsymbl >0 or =0, the symbol is drawn by subroutine ngon.
00031 c
00032 c If jsymbl < 0, the symbol is a centered "simbol" symbol.
00033 c Defining iascii = |jsymbl|, the first font is obtained
00034 c for iascii.le.127, the second for 128.le.iascii.le.223
00035 c and the third for iascii.ge.224, so, for example, 58
00036 c becomes a colon (":"), 58+96=154 is an integral sign ("@:")
00037 c and 58+192=250 is a gothic "z" ("%:").
00038 c
00039 c No lines are drawn outside the box produced by "eframe"
00040 c if mode is nonzero.
00041 c
00042 c If htsym < 0., the "simbol" symbols will not be centered:
00043 c the symbol will be drawn with the array point at the
00044 c bottom left-hand corner.
00045 c
00046 dimension xarray(1),yarray(1)
00047 c
00048 logical in0
00049 character sim*3
00050 c
00051 common /scales/ xminim,xmax,dxinch,yminim,ymax,dyinch,rlen,slen
00052 common /fr bnds/ mode
00053 common /mline on/ imline
00054 c
00055 common /dash/ dpatrn(10),dpat,npatrn,ipat,lpen
00056 c
00057 common /ngon stars/ istar
00058 data istar/0/
00059 c
00060 cinch(x,x0,dxi) = (x-x0)*dxi
00061 c
00062 call routine id('mline')
00063 idline = 0
00064 go to 1
00065 c
00066 c-----------------------------------------------------------------------
00067 c
00068 entry dline(xarray,yarray,n,jth,jsymbl,htsym)
00069 c
00070 c As for mline, but plot dashed lines.
00071 c
00072 call routine id('dline')
00073 idline = 1
00074 c
00075 c Reinitialize the dash pattern.
00076 c
00077 dpat = dpatrn(1)
00078 ipat = 1
00079 lpen = 2
00080 c
00081 c-----------------------------------------------------------------------
00082 c
00083 1 if (jth.ne.0) then
00084 c
00085 c *** plot symbols ***
00086 c
00087 hite = abs(htsym)
00088 c
00089 if(jsymbl.lt.0)then
00090 iascii = -jsymbl
00091 if(iascii.le.127)then
00092 nsym = -1
00093 sim = char(iascii)
00094 else if(iascii.le.223)then
00095 nsym = -2
00096 sim = '@'
00097 else
00098 nsym = -2
00099 sim = '%'
00100 end if
00101 if(htsym.lt.0.)nsym = -nsym
00102 end if
00103 c
00104 int = abs(jth)
00105 do i=1,n,int
00106 x1 = cinch(xarray(i),xminim,dxinch)
00107 y1 = cinch(yarray(i),yminim,dyinch)
00108 if (mode.eq.0
00109 & .or.(x1.ge.0..and.x1.le.rlen
00110 & .and.y1.ge.0..and.y1.le.slen)) then
00111 if(jsymbl.ge.0.or.htsym.eq.0.)then
00112 if(istar.eq.0)then
00113 call ngon(x1,y1,.5*htsym,jsymbl,0.)
00114 else
00115 call ngon(x1,y1,.5*htsym,-jsymbl,0.)
00116 end if
00117 else
00118 if (iascii.le.1) then
00119 c
00120 c Encode the number of the point in sim.
00121 c
00122 ii = i
00123 do while (ii.gt.61)
00124 ii = ii - 61
00125 end do
00126 if (ii.le.9) then
00127 sim = char(48+ii)
00128 else if (ii.le.35) then
00129 sim = char(87+ii)
00130 else
00131 sim = char(29+ii)
00132 end if
00133 end if
00134 call simbol(x1,y1,hite,sim,0.,nsym)
00135 end if
00136 end if
00137 end do
00138 c
00139 if (jth.lt.0) return
00140 end if
00141 c
00142 c *** plot line ***
00143 c
00144 x0 = cinch(xarray(1),xminim,dxinch)
00145 y0 = cinch(yarray(1),yminim,dyinch)
00146 in0 = (x0.ge.0..and.x0.le.rlen.and.y0.ge.0..and.y0.le.slen)
00147 c
00148 c The following distinction is necessary to set up "plotin" internally:
00149 c
00150 if (mode.eq.0) then
00151 call plot(x0,y0,3)
00152 else
00153 call plotin(x0,y0,3)
00154 imline = 1
00155 end if
00156 c
00157 do i=2,n
00158 x1 = cinch(xarray(i),xminim,dxinch)
00159 y1 = cinch(yarray(i),yminim,dyinch)
00160 if (mode.eq.0) then
00161 if (idline.eq.0) then
00162 call plot(x1,y1,2)
00163 else
00164 call dplot(x1,y1,2)
00165 end if
00166 else
00167 c
00168 c Is there anything to plot? (Problems with slow graphics devices.)
00169 c
00170 if (max(x0,x1).ge.0..and.min(x0,x1).le.rlen
00171 & .and.max(y0,y1).ge.0..and.min(y0,y1).le.slen) then
00172 c
00173 if (.not.in0) call plotin(x0,y0,3)
00174 c
00175 if (idline.eq.0) then
00176 call plotin(x1,y1,2)
00177 else
00178 call dplotin(x1,y1,2)
00179 end if
00180 c
00181 in0 = .true.
00182 else
00183 in0 = .false.
00184 end if
00185 x0 = x1
00186 y0 = y1
00187 end if
00188 end do
00189 c
00190 c Make sure all pointers are set to the end of the array.
00191 c
00192 if (mode.eq.0) then
00193 call plot(x1,y1,3)
00194 else
00195 call plotin(x1,y1,3)
00196 imline = 0
00197 end if
00198 c
00199 end