C 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 dimension x1(0:20),y1(0:20) n=20 do 10 i=0,n x1(i)=1.0*(10.0)**(float(i)/float(n)*4.0) y1(i)=f(x1(i)) 10 continue do 20 i=0,n x1(i)=alog10(x1(i)) y1(i)=alog10(y1(i)) 20 continue call linewidth(1.5) call linety(1) call setgray(0.0) call plot(x1(0),y1(0),3) do 30 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) 30 continue 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() continue 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 10 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 20 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() 20 continue 10 continue ny=4 do 30 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 40 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() 40 continue 30 continue 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