C Plotting program for general purpose using postscript call init call readdata call viewport(0.2,0.2,0.8,0.8) call xyworld(0.0,0.0,1.0,1.0) call frame call plotd call fin stop end subroutine readdata common /maxmin/xmax,xmin,ymax,ymin,n common /dataxy/x1(100),y1(100) open (2,file='pg.data',status='OLD') do 10 i=1,100 read(2,*,end=99) x1(i),y1(i) 10 continue 99 continue n=i-1 xmax=x1(1) xmin=x1(1) ymax=y1(1) ymin=y1(1) do 20 i=2,n if(xmax.lt.x1(i)) xmax=x1(i) if(xmin.gt.x1(i)) xmin=x1(i) if(ymax.lt.y1(i)) ymax=y1(i) if(ymin.gt.y1(i)) ymin=y1(i) 20 continue return end subroutine plotd common /maxmin/xmax,xmin,ymax,ymin,n common /dataxy/x1(100),y1(100) call linewidth(1.5) call linety(1) do 20 i=1,n x1(i)=(x1(i)-xmin)/(xmax-xmin) y1(i)=(y1(i)-ymin)/(ymax-ymin) 20 continue call plot(x1(1),y1(1),3) do 30 i=2,n call plot(x1(i),y1(i),2) 30 continue call stroke() call plot(0.9,-0.06,3) write(1,100) xmax call plot(0.4,-0.06,3) write(1,100) (xmax+xmin)/2.0 call plot(-0.1,-0.06,3) write(1,100) xmin call plot(-0.2,0.98,3) write(1,100) ymax call plot(-0.2,0.48,3) write(1,100) (ymax+ymin)/2.0 call plot(-0.2,-0.02,3) write(1,100) ymin 100 format(1x,'(',1pe8.1,') show') continue return end subroutine frame common /maxmin/xmax,xmin,ymax,ymin,n common /dataxy/x1(100),y1(100) call linewidth(1.0) call rect(0.0,0.0,1.0,1.0,0.0,1.0,1) call textx(0.75,0.0,1,'x') nx=2 do 10 ix=1,nx-1 x=float(ix)/float(nx) dy=0.03 call plot(x,0.0,3) call plot(x,dy,2) call stroke() 10 continue call texty(0.0,0.75,1,'y') ny=2 do 20 iy=1,ny-1 y=float(iy)/float(ny) dx=0.03 call plot(0.0,y,3) call plot(dx,y,2) call stroke() 20 continue return end