PROGRAM PLOT1 C This program reads in a 2-column file and plots it. C .......................... PARAMETER (NMAX=2000) REAL X(NMAX), Y(NMAX) CHARACTER*50 INPUTFILE C .......................... WRITE(*,'(A,$)') 'Enter the name of the INPUT file : ' READ (*,'(A)') INPUTFILE IERR = 0 N= NMAX CALL GET_DATA (INPUTFILE, N, X, Y, ierr) IF (IERR .NE. 0) STOP '** error reading in data from file **' C .................... C Find min and max of X and Y. C Use the FORTRAN intrinsic functions MIN and MAX. XMIN = X(1) YMIN = Y(1) XMAX = XMIN YMAX = YMIN DO I=1,N XMIN = MIN (XMIN, X(I) ) XMAX = MAX (XMAX, X(I) ) YMIN = MIN (YMIN, Y(I) ) YMAX = MAX (YMAX, Y(I) ) END DO C .................... C PGPLOT calls to generate the plot. CALL PGBEGIN( 0, '?', 1, 1) CALL PGENV ( XMIN,XMAX,YMIN,YMAX, 0, 0) CALL PGLINE (N,X,Y) CALL PGEND C .......................... STOP 'PLOT1 finished.' END C-----------------------------------------------------------------