! Plotting program for general purpose using postscript call init call viewport(0.2,0.2,0.8,0.8) call xyworld(0.0,0.0,4.0,4.0) call frame call plotd call fin stop end function f(x) f=x**3/(5.0+x**2)+10.0 return end subroutine plotd REAL(4) :: x1(0:20),y1(0:20) n=20 do i=0,n x1(i)=1.0*(10.0)**(float(i)/float(n)*4.0) y1(i)=f(x1(i)) end do do i=0,n x1(i)=alog10(x1(i)) y1(i)=alog10(y1(i)) end do call linewidth(1.5) call linety(1) call setgray(0.0) call plot(x1(0),y1(0),3) do i=1,n-2 call spline1(x1(i-1),y1(i-1),x1(i),y1(i),x1(i+1),y1(i+1),x1(i+2), & y1(i+2),-1) end do call spline1(x1(i-3),y1(i-3),x1(i-1),y1(i-1),x1(i),y1(i),x1(i+1), & y1(i+1),0) call spline1(x1(i-3),y1(i-3),x1(i-1),y1(i-1),x1(i),y1(i),x1(i+1), & y1(i+1),1) call stroke() return end subroutine frame call linewidth(1.0) call rect(0.0,0.0,4.0,4.0,0.0,1.0,1) nx=4 do ix=0,nx-1 call setgray(0.3) x=float(ix) dy=4.0 if(ix.ne.0) then call plot(x,0.0,3) call plot(x,dy,2) call stroke() end if do ixx=2,9 call setgray(0.8) x=float(ix)+alog10(float(ixx)) call plot(x,0.0,3) call plot(x,dy,2) call stroke() end do end do ny=4 do iy=0,ny-1 call setgray(0.5) y=float(iy) dx=4.0 if (iy.ne.0) then call plot(0.0,y,3) call plot(dx,y,2) call stroke() end if do iyy=2,9 call setgray(0.8) y=float(iy)+alog10(float(iyy)) call plot(0.0,y,3) call plot(dx,y,2) call stroke() end do end do call setgray(0.0) call textx(3.5,0.0,1,'x') call textx(0.0,0.02,1,'1') call textx(1.0,0.02,2,'10') call textx(2.0,0.02,3,'100') call textx(3.0,0.02,4,'1000') call textx(4.0,0.02,5,'10000') call texty(0.0,3.5,1,'y') call texty(0.0,0.0,1,'1') call texty(0.0,1.0,2,'10') call texty(0.0,2.0,3,'100') call texty(0.0,3.0,4,'1000') call texty(0.0,4.0,5,'10000') return end