Quick Plotting
The Aplot library contains a simplified plot interface in Fortran that allows for the rapid display of array or vector contents with a single subroutine call. By using the quick_aplot module, developers can rapidly plot the contents of an array.
Using Quick Plotting
Consider a vector of real numbers that the user might be interested in visually inspecting during the course of a program’s execution. The code to do so is as simple as:
use quick_aplot
...
real, dimension(100)::y
...
call plot(y)
The above code will simply plot the contents of the y vector. If an array needs to be plotted where each “data series” that needs to be visualized is in each column, the call is just as simple:
use quick_aplot
...
real, dimension(100, 5)::y
...
call plot(y)
The above will generate 5 lines on the chart. Additionally, the user can add a vector defining x-axis values as well in either case:
use quick_aplot
...
real, dimension(100, 5)::y
real, dimension(100)::x
...
call plot(y, x=x)
The plot interface will also accept aplot styles as input if desired:
use quick_aplot
use aplot, only: APLOT_STYLE_DOT
...
real, dimension(100, 5)::y
real, dimension(100)::x
...
call plot(y, x=x, style=APLOT_STYLE_DOT)
The plot subroutine will accept real, real(kind=8), and integer inputs for both the data series and the optional x-axis series.