RUN_GNUPLOT runs GNUPLOT with a given command file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*) | :: | command_file_name |
subroutine run_gnuplot ( command_file_name ) ! !******************************************************************************* ! !! RUN_GNUPLOT runs GNUPLOT with a given command file. ! ! ! Discussion: ! ! The GNUPLOT program, version 3.7, must be available. To check whether ! this is so, try typing ! ! which gnuplot ! ! If the response is ! ! gnuplot: command not found ! ! then you're going to have to make GNUPLOT available. ! ! At ISU, this may require that you issue the command ! ! add gnu ! ! You may need to set the environment variable GNUTERM: ! ! setenv GNUTERM x11 ! ! so that GNUPLOT automatically displays to your X window terminal. ! ! ! This routine expects that there is a text file containing the appropriate ! commands to GNUPLOT to display your picture. There are a number of ! routines in this package that will do this for simple plotting tasks. ! Most of them require that you also set up a file of data to be plotted. ! ! Once this routine invokes GNUPLOT, a graphics window should open ! up, and the FORTRAN program will pause. Hitting RETURN should advance ! to the next picture, or terminate the window at the end, allowing the ! FORTRAN routine to proceed. ! ! ! You can look at the data and command files created by the routines. ! Moreover, you can easily modify the command file to change the options ! used in GNUPLOT, and then run GNUPLOT interactively, as in: ! ! gnuplot commands ! ! In particular, if you want a PostScript version of your graphics files, ! insert the command "set term postscript" at the beginning of the command ! file and run gnuplot as follows: ! ! gnuplot commands > mypicture.ps ! ! You will also have to hit RETURN once for each plot that is made. ! ! Modified: ! ! 21 February 2001 ! ! Author: ! ! John Burkardt ! ! Parameters: ! ! Input, character ( len = * ) COMMAND_FILE_NAME, the name of the ! command file. ! implicit none ! character ( len = 512 ) command character ( len = * ) command_file_name !integer status ! ! Issue a command to the system that will startup GNUPLOT, using ! the file we just wrote as input. ! write ( command, * ) 'gnuplot ' // '"' // trim ( command_file_name ) // '"' !~ call execute_command_line(trim ( command ), wait=.false., exitstat=status) call system(trim ( command )) return endsubroutine run_gnuplot