! Plotting routine of equi-streamline in colors parameter (nx=200,ny=100) 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 ! subroutine frame integer :: nx=4,ny=2,ix,iy real(4) :: dx=0.05, dy=0.05 call linewidth(1.0) call rect(0.0,0.0,2.0,1.0,0.0,1.0,1) do 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() end do do 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() end do 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) real(4) :: pi=3.14159,x,y,f f=sin(2.0*pi*x)*sin(pi*y) return end subroutine draw(fmax,fmin,nline) integer :: nx=200,ny=100,ix,iy real(4) :: dx,dy,x,y,r,g,b dx=2.0/float(nx) dy=1.0/float(ny) do iy=1,ny y=float(iy)/float(ny) do 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) call closepath r=color*0.8+0.2 g=0.1 b=(1.0-color)*0.8+0.2 call setrgb(r,g,b) call fill call stroke end do end do return end