ogpf is an object based module developed in Fortran 2003 / 2008 with
object-oriented concept. It implements an interface to 2D/3D plotting in
gnuplot.
The syntax ensembles the plot and surf commands in Matlab
and Octave. There are some helper functions like linspace, and meshgrid
to facilitate the plotting procedure.
There are these main procedures in ogpf
- plot
- plot a single vector v
- plot a vector y against vector x
- plot up to four pairs of x-y set at the same time
- plot a matrix Y versus a vector x
- surf
- surface plot
- mesh plot
- contour plot
- script
- meshgrid
- linspace
ogpf implements the interface through an object called
gpf. It contains many methods and properties for making publication quality plots using gnuplot.
script methodThe
script method is a powerful procedure accepts almost any gnuplot valid
command and create a script file to be executed by gnuplot.
interactive modeIt is possible to run the gnuplot interactively from fortran.
Save to fileThere is an option, to save the
ogpf output into a file which can be invoked later from gnuplot.
How to use
Requirements- A fortran compiler supports Fortran 2003, like gfortran 4.7 (
http://gcc.gnu.org/GFortran), other Fortran compilers also can be used.
- gnuplot 4.5 and later (
http://gnuplot.info)
Make sure gnuplot is in your path. (Open a command window and type gnuplot to see if it is in your path)
- Download the source code and demo file from download area
- Create a fortran project contains the ogpf.f90 and demo.f90, compile, and build it
- Run the executable (output of step 2) and select the example you like to run
Download link: