a GNUPLOT / FORTRAN90 interface

GNUFOR is a FORTRAN90 library which provides an interface to the GNUPLOT plotting software.

GNUFOR makes it possible, while running a FORTRAN90 program on a UNIX system, to generate some data and request an immediate plot. This is done by issuing a SYSTEM command that starts up GNUPLOT, and feeding it the appropriate commands and data. The FORTRAN90 program pauses while the graph is displayed in an X window, and the user can admire the plots for a while, before hitting return and giving control back to the FORTRAN90 program.

Thanks to some suggestions of Morag Am-Shallem, the FORTRAN90 program can continue execution without waiting for GNUPLOT. In this way, for example, a program that was computing some quantity can, from time to time, display an updated plot of what it is doing. A user can glance at the picture from time to time, while the FORTRAN90 program merrily computes away. Something like this can be done with a C program that calls the GNUPLOT_I package.

To use this program, the command "gnuplot" must be in your path.


The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.


GNUFOR is available in a FORTRAN77 version and a FORTRAN90 version.

Related Data and Programs:

GNUPLOT, examples which illustrate the use of the GNUPLOT graphics program.

GNUPLOT_I, a C library which allows an executing C, C++, FORTRAN77 or FORTRAN90 program to interact with the GNUPLOT graphics program.

GNUPLOT_I_EXAMPLES, C programs which demonstrate the use of the GNUPLOT_I library for interactive runtime GNUPLOT graphics.

GNUPLOT_I_EXAMPLES, C++ programs which demonstrate the use of the GNUPLOT_I library for interactive runtime GNUPLOT graphics.

GRAPHICS_EXAMPLES_GNUPLOT, gnuplot scripts which illustrate how various kinds of data can be displayed and analyzed graphically using the interactive executable graphics program gnuplot.

SPRING_ODE2, a FORTRAN90 program which shows how gnuplot graphics can be used to illustrate a solution of the ordinary differential equation (ODE) that describes the motion of a weight attached to a spring.


  1. Philipp Janert,
    Gnuplot in Action: Understanding Data with Graphs,
    Manning, 2008,
    ISBN: 1-933988-39-8.
  2. Thomas Williams, Colin Kelley, John Campbell, David Kotz, Russell Lang,
    gnuplot, An Interactive Plotting Program,
    The Free Software Foundation, 1990.
  3., the GNUPLOT Website.

Source Code:

Examples and Tests:







List of Routines:

You can go up one level to the FORTRAN90 source codes.

Last revised on 24 June 2011.