c Plotting routine of equi-streamline in colors parameter (nx=200,ny=100) common /par/dx,dy call init call viewport(0.2,0.2,0.8,0.5) call xyworld(0.0,0.0,2.0,1.0) call frame call draw(1.0,-1.0,20) call frame call fin stop end c subroutine frame call linewidth(1.0) call rect(0.0,0.0,2.0,1.0,0.0,1.0,1) nx=4 do 10 ix=0,2*nx-1 call setgray(0.0) x=float(ix)/float(nx)*2.0 dy=0.05 call plot(x,0.0,3) call plot(x,dy,2) call stroke() 10 continue ny=2 do 20 iy=0,ny-1 call setgray(0.0) y=float(iy)/float(ny) dx=0.05 call plot(0.0,y,3) call plot(dx,y,2) call stroke() 20 continue call textx(1.5,0.0,1,'x') call textx(0.0,0.02,1,'0') call textx(1.0,0.02,1,'1') call textx(2.0,0.02,1,'2') call texty(0.0,0.75,1,'y') call texty(0.0,0.0,1,'0') call texty(0.0,0.5,3,'0.5') call texty(0.0,1.0,1,'1') return end function f(x,y) pi=3.14159 f=sin(2.0*pi*x)*sin(pi*y) return end subroutine draw(fmax,fmin,nline) parameter (nx=200,ny=100) dx=2.0/float(nx) dy=1.0/float(ny) do 10 iy=1,ny y=float(iy)/float(ny) do 10 ix=1,nx x=float(ix)/float(nx) color=(f(x,y)-fmin)/(fmax-fmin) call plot((ix-1)*dx,(iy-1)*dy,3) call plot(ix*dx,(iy-1)*dy,2) call plot(ix*dx,iy*dy,2) call plot((ix-1)*dx,iy*dy,2) write(1,*) ' closepath' r=color*0.8+0.2 g=0.1 b=(1.0-color)*0.8+0.2 call setrgb(r,g,b) write(1,*) ' fill' write(1,*) ' stroke' 10 continue return end