Skip to main content

PLPlot example 2

!!! note "" This example shows how to plot a graph by using plplot.

Modules and classes

  • [[PLPlot_]]

Usage

IMPORT modules and declare variables

PROGRAM main
USE easifemBase
USE easifemClasses
IMPLICIT NONE
REAL( DFP ), ALLOCATABLE :: x( : ), y( : )
TYPE( PLPlot_ ) :: obj

!!! note "" Prepare data to be plotted.

  x = linspace( 0.0_DFP, 1.0_DFP, 101 )
y = x**2

!!! note "svg" LinePlot method

  CALL obj%LinePlot( x, y, "test2a.svg" )

!!! note "svg" LinePlot method

  CALL obj%LinePlot( x=x, y=y, filename="test2b.svg", &
& lineColor="r", lineType="-", lineWidth=2.0_DFP, &
& pointColor="black", pointType=PS_PLUS, pointSize=4.0_DFP )

END PROGRAM main