Skip to content

execplot

Fabian Kindermann edited this page Apr 1, 2021 · 5 revisions
subroutine execplot(xlim, xticks, xlabel, ylim, yticks, ylabel, title, legend, filename, filetype, 
output)

Description:

Our toolbox provides a set of routines that can be used for plotting graphs directly out of your Fortran program. The plotting process for 2D-graphs thereby consists of two steps. The subroutines plot and plot_hist allow to add plotdata (i.e. lines, dots and histograms) to your plots (almost as many as you want). After you’ve added all the necessary data to your plot, you can start the plotting process by means of the subroutine execplot, which will transfer your plot data to the program GNUplot and start this program, so that your graphs will be displayed in a pop-up window.

The subroutine execplot can be used for starting the plot program. It contains several optional input arguments by which you can control the appearance of your plot.

Optional arguments:

  • real*8 :: xlim(2)
    This one-dimensional array of length two defines the plotting range on the x-axis of your plot. The first entry gives the lower bound of the range, the second the upper bound.
  • real*8 :: xticks
    This argument defines the distance between two successive tick values on the x-axis of the plot.
  • character(LEN=*) :: xlabel
    This character variable allows to attach a label to the x-axis informing about its content.
  • real*8 :: ylim(2)
    This one-dimensional array of length two defines the plotting range on the y-axis of your plot. The first entry gives the lower bound of the range, the second the upper bound.
  • real*8 :: yticks
    This argument defines the distance between two successive tick values on the y-axis of the plot.
  • character(LEN=*) :: ylabel
    This character variable allows to attach a label to the y-axis informing about its content.
  • character(LEN=*) :: title
    This character variable will be displayed as title above the plot.
  • character(LEN=2) :: legend
    This character of length two allows to specify where the legend of the plot should be located. There is a total of 12 options. The first character of the input variable defines whether the legend should be placed on the left, center or right part of the plot. The second character defines whether the legend should be placed on the inside north area of the graph (n), on the inside south area (s), outside of the graph (o) or below the graph (b). If no input is present, then the subroutine places the legend below the graph in the center location. The following graphical representation summarizes your choice options.
    co 
    ------------------------------
    |ln cn rn|
    | |
    | |
    lo | | ro
    | |
    | |
    |ls cs rs|
    ------------------------------
    lb cb rb
    
  • character(LEN=*) :: filename
    This character variable allows to specify a filename under which the graph should be exported. If no input is present, then the graph is not exported at all.
  • character(LEN=*) :: filetype
    This character variable allows to specify a file type under which the graph should be exported. You can choose from either 'eps' or 'png'. Note that this option only takes effect, if the variable filename is specified. If no input is present, then the subroutine exports the graph in 'eps' format.
  • character(LEN=*) :: output
    This character variable allows you to export the actual raw plotting data in GNUplot format. This can be a useful option if you want to manually work on the appearance of your graph. output thereby defines the name of the output files created by this subroutine. Please see the documentation of GNUplot for further details.

References

  • For further reading refer to:
  • This routine is used in the following programs:
    • prog01_17.f90
    • prog02_15.f90
    • prog02_16.f90
    • prog02_17.f90
    • prog02_18.f90
    • prog04_01.f90
    • prog04_04.f90
    • prog04_05.f90
    • prog04_08.f90
    • prog04_09.f90
    • prog08_01.f90
    • prog08_02.f90
    • prog08_03.f90
    • prog08_04.f90
    • prog08_05.f90
    • prog08_06.f90
    • prog08_07.f90
    • prog09_01.f90
    • prog09_02.f90
    • prog09_03.f90
    • prog09_04.f90
    • prog09_09.f90
    • prog09_10.f90
    • prog10_01.f90
    • prog10_02.f90
    • prog10_03.f90
    • prog10_04.f90
    • prog10_05.f90
    • prog10_06.f90
Clone this wiki locally