plplotlib_mod Module

module~~plplotlib_mod~~UsesGraph module~plplotlib_mod plplotlib_mod module~kinds_mod kinds_mod module~kinds_mod->module~plplotlib_mod module~utilities_mod utilities_mod module~kinds_mod->module~utilities_mod plplot plplot plplot->module~plplotlib_mod module~utilities_mod->module~plplotlib_mod iso_fortran_env iso_fortran_env iso_fortran_env->module~utilities_mod
Help

Wrapper module for plplot to give it a more matplotlib like personality

Used By

module~~plplotlib_mod~~UsedByGraph module~plplotlib_mod plplotlib_mod program~basic_prg basic_prg module~plplotlib_mod->program~basic_prg program~examples_prg examples_prg module~plplotlib_mod->program~examples_prg program~animate_prg animate_prg module~plplotlib_mod->program~animate_prg program~logo_prg logo_prg module~plplotlib_mod->program~logo_prg
Help

Functions

public function binData(d, N, db, normalize) result(o)

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(:):: d

Data for binning

integer, intent(in), optional :: N

Number of bins

real(kind=wp), intent(in), optional dimension(2):: db

Boundaries of bin range

integer, intent(in), optional :: normalize

Normalization type (1=sum, 2=bin size, 3=maxval)

Return Value real(kind=wp), dimension(:,:),allocatable

Description

Count data in each bin


Subroutines

public subroutine figure()

Arguments

None

Description

Create a new figure

public subroutine subplot(ny, nx, i, aspect, is3d)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: ny

Number of subplot rows

integer, intent(in) :: nx

Number of subplot columns

integer, intent(in) :: i

Subplot to use

real(kind=wp), intent(in), optional :: aspect

Aspect ratio of the axes

logical, intent(in), optional :: is3d

Description

Create a set of axes on a figure

public subroutine xylim(xb, yb)

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(2):: xb

x-range of plot

real(kind=wp), intent(in), dimension(2):: yb

y-range of plot

Description

Set the x and y ranges of the plot

public subroutine xlim(xl, xh)

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in) :: xl
real(kind=wp), intent(in) :: xh

Description

Set the limits of the x-axis

public subroutine ylim(yl, yh)

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in) :: yl
real(kind=wp), intent(in) :: yh

Description

Set the limits of the y-axis

public subroutine xyzlim(xb, yb, zb, altitude, azimuth, zoom)

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(2):: xb

x-range of plot

real(kind=wp), intent(in), dimension(2):: yb

y-range of plot

real(kind=wp), intent(in), dimension(2):: zb

z-range of plot

real(kind=wp), intent(in), optional :: altitude

Altitude angle of plot in degrees

real(kind=wp), intent(in), optional :: azimuth

Azimuth angle of plot in degrees

real(kind=wp), intent(in), optional :: zoom

Zoom ratio (default 1.0)

Description

Set the limits for a 3d plot

public subroutine ticks(dx, dy, logx, logy, color, linewidth)

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), optional :: dx

Spacing between ticks on x-axis

real(kind=wp), intent(in), optional :: dy

Spacing between ticks on y-axis

logical, intent(in), optional :: logx

Flag for log-ticks and labels on x-axis

logical, intent(in), optional :: logy

Flag for log-ticks and labels on y-axis

character(len=*), intent(in), optional :: color

Color code for ticks, box, and labels

real(kind=wp) , optional :: linewidth

Line width for ticks and box

Description

Set the ticks for the axes

public subroutine box(xLabel, yLabel, zLabel, color)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: xLabel

Label for x-axis

character(len=*), intent(in) :: yLabel

Label for x-axis

character(len=*), intent(in) :: zLabel

Label for z-axis

character(len=*), intent(in), optional :: color

Color of labels

Description

Set x,y and plot labels

public subroutine xticks(d, logScale, primary, secondary, color, linewidth)

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), optional :: d

Spacing between ticks

logical, intent(in), optional :: logScale

Flag for log-ticks and labels

logical, intent(in), optional :: primary

Draw primary axis

logical, intent(in), optional :: secondary

Draw secondary axis

character(len=*), intent(in), optional :: color

Color code for ticks, box, and labels

real(kind=wp) , optional :: linewidth

Line width for ticks and box

Description

Set the ticks for the x-axis

public subroutine yticks(d, logScale, primary, secondary, color, linewidth)

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), optional :: d

Spacing between ticks

logical, intent(in), optional :: logScale

Flag for log-ticks and labels

logical, intent(in), optional :: primary

Draw primary axis

logical, intent(in), optional :: secondary

Draw secondary axis

character(len=*), intent(in), optional :: color

Color code for ticks, box, and labels

real(kind=wp) , optional :: linewidth

Line width for ticks and box

Description

Set the ticks for the y-axis

public subroutine labels(xLabel, yLabel, plotLabel, color)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: xLabel

Label for x-axis

character(len=*), intent(in) :: yLabel

Label for x-axis

character(len=*), intent(in) :: plotLabel

Label entire plot

character(len=*), intent(in), optional :: color

Color of labels

Description

Set x,y and plot labels

public subroutine xlabel(label, color)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: label

Label for axis

character(len=*), intent(in), optional :: color

Color of labels

Description

Set x-label

public subroutine ylabel(label, color)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: label

Label for axis

character(len=*), intent(in), optional :: color

Color of labels

Description

Set y-label

public subroutine title(label, color)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: label

Label for plot

character(len=*), intent(in), optional :: color

Color of labels

Description

Set plot title

public subroutine colorbar(z, N, leftLabel, rightLabel)

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(:,:):: z

Data used for levels computation

integer, intent(in) :: N

Number of levels to compute

character(len=*), intent(in), optional :: leftLabel

Label for left side of colorbar

character(len=*), intent(in), optional :: rightLabel

Label for right side of colorbar

Description

Add a colorbar to the top of the plot

public subroutine colorbar2(z, N, leftLabel, rightLabel)

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(:,:):: z

Data used for levels computation

integer, intent(in) :: N

Number of levels to compute

character(len=*), intent(in), optional :: leftLabel

Label for left side of colorbar

character(len=*), intent(in), optional :: rightLabel

Label for right side of colorbar

Description

Add a colorbar to the top of the plot

public subroutine legend(corner, series, lineWidths, markScales, markCounts, ncol)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: corner

Corner for legend

character(len=*), intent(in), dimension(:,:):: series

Data series in rows [name,textColor,lineStyle,lineColor,markStyle,markColor,boxColor]

real(kind=wp), intent(in), optional dimension(:):: lineWidths

Line widths for the plots

real(kind=wp), intent(in), optional dimension(:):: markScales

Marker sizes for the plots

integer, intent(in), optional dimension(:):: markCounts

Marker counts for the plots

integer, intent(in), optional :: ncol

Number of columns

Description

Create legend for plot data

public subroutine hist(d, N, db, relWidth, fillColor, fillPattern, lineColor, lineWidth)

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(:):: d

Data for binning

integer, intent(in), optional :: N

Number of bins

real(kind=wp), intent(in), optional dimension(2):: db

Boundaries of bin range

real(kind=wp), intent(in), optional :: relWidth

Relative width of bars (default 0.8)

character(len=*), intent(in), optional :: fillColor

Color of bar fills

character(len=*), intent(in), optional :: fillPattern

Pattern of bar fills

character(len=*), intent(in), optional :: lineColor

Color of lines around bars

real(kind=wp) , optional :: lineWidth

Width of lines around bars

Description

Create a histogram

public subroutine scatter(x, y, c, s, markColor, markStyle, markSize)

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(:):: x

x-coordinates of data

real(kind=wp), intent(in), dimension(:):: y

y-coordinates of data

real(kind=wp), intent(in), optional dimension(:):: c

Data for smooth coloring

real(kind=wp), intent(in), optional dimension(:):: s

Data for marker scaling

character(len=*), intent(in), optional :: markColor

Color of markers; overridden by z

character(len=*), intent(in), optional :: markStyle

Style of markers

real(kind=wp), intent(in), optional :: markSize

Size of markers

Description

Create scatter plot of data

public subroutine plot(x, y, lineColor, lineStyle, lineWidth, markColor, markStyle, markSize)

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(:):: x

x-data for plot

real(kind=wp), intent(in), dimension(:):: y

y-data for plot

character(len=*), intent(in), optional :: lineColor

Color of line

character(len=*), intent(in), optional :: lineStyle

Style of line; '' for no line

real(kind=wp), intent(in), optional :: lineWidth

Width of line

character(len=*), intent(in), optional :: markColor

Color of markers, if any

character(len=*), intent(in), optional :: markStyle

Style of markers; '' or absent for none

real(kind=wp), intent(in), optional :: markSize

Size of markers, if any

Description

Plot data using lines and or markers

public subroutine plot3(x, y, z, lineColor, lineStyle, lineWidth, markColor, markStyle, markSize)

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(:):: x

x-data for plot

real(kind=wp), intent(in), dimension(:):: y

y-data for plot

real(kind=wp), intent(in), dimension(:):: z

z-data for plot

character(len=*), intent(in), optional :: lineColor

Color of line

character(len=*), intent(in), optional :: lineStyle

Style of line; '' for no line

real(kind=wp), intent(in), optional :: lineWidth

Width of line

character(len=*), intent(in), optional :: markColor

Color of markers, if any

character(len=*), intent(in), optional :: markStyle

Style of markers; '' or absent for none

real(kind=wp), intent(in), optional :: markSize

Size of markers, if any

Description

Plot data using lines and or markers

public subroutine contour(x, y, z, N, lineColor, lineStyle, lineWidth)

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(:):: x

x-coordinates of data

real(kind=wp), intent(in), dimension(:):: y

y-coordinates of data

real(kind=wp), intent(in), dimension(:,:):: z

Data for contouring

integer, intent(in), optional :: N

Number of levels to use in contour

character(len=*), intent(in), optional :: lineColor

Color of contour lines

character(len=*), intent(in), optional :: lineStyle

Style of contour lines

real(kind=wp) , optional :: lineWidth

Width of contour lines

Description

Plot contour lines

public subroutine surface(x, y, z, N, lineStyle)

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(:):: x

x-coordinates of data

real(kind=wp), intent(in), dimension(:):: y

y-coordinates of data

real(kind=wp), intent(in), dimension(:,:):: z

Data for contouring

integer, intent(in), optional :: N

Number of levels to use in surface colors

character(len=*), intent(in), optional :: lineStyle

Style for xy lines ( '-' = on, '' = off )

Description

Plot a 3d surface

public subroutine wireframe(x, y, z, lineColor)

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(:):: x

x-coordinates of data

real(kind=wp), intent(in), dimension(:):: y

y-coordinates of data

real(kind=wp), intent(in), dimension(:,:):: z

Data for contouring

character(len=*), intent(in), optional :: lineColor

Color of contour lines

Description

Plot a 3d wireframe

public subroutine contourf(x, y, z, N)

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(:):: x

x-coordinates of data

real(kind=wp), intent(in), dimension(:):: y

y-coordinates of data

real(kind=wp), intent(in), dimension(:,:):: z

Data for contouring

integer, intent(in), optional :: N

Number of levels to use in contour

Description

Plot filled contours

public subroutine quiver(x, y, u, v, s, c, scaling, lineColor, lineStyle, lineWidth)

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(:):: x

x-positions of vectors

real(kind=wp), intent(in), dimension(:):: y

y-positions of vectors

real(kind=wp), intent(in), dimension(:,:):: u

u-components of vectors

real(kind=wp), intent(in), dimension(:,:):: v

v-components of vectors

real(kind=wp), intent(in), optional dimension(:,:):: s

Scale of vectors

real(kind=wp), intent(in), optional dimension(:,:):: c

Color values for vectors

real(kind=wp), intent(in), optional :: scaling

Scaling of vectors < 0 = Automatic, then scaled 0 = Automatic

character(len=*), intent(in), optional :: lineColor

Color of vectors

character(len=*), intent(in), optional :: lineStyle

Style of vectors' lines

real(kind=wp) , optional :: lineWidth

Width of vectors' lines

Description

Plot vectors

public subroutine bar(x, y, c, relWidth, fillColor, fillPattern, lineColor, lineWidth)

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(:):: x

x-positions of the bars' centers

real(kind=wp), intent(in), dimension(:):: y

y-positions of the bars' tops

real(kind=wp), intent(in), optional dimension(:):: c

Color scale for bars

real(kind=wp), intent(in), optional :: relWidth

Relative width of bars (default 0.8)

character(len=*), intent(in), optional :: fillColor

Color of bar fills

character(len=*), intent(in), optional :: fillPattern

Pattern of bar fills

character(len=*), intent(in), optional :: lineColor

Color of lines around bars

real(kind=wp) , optional :: lineWidth

Width of lines around bars

Description

Create a bar graph

public subroutine barh(y, x, c, relWidth, fillColor, fillPattern, lineColor, lineWidth)

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(:):: y

y-positions of the bars' centers

real(kind=wp), intent(in), dimension(:):: x

x-positions of the bars' tops

real(kind=wp), intent(in), optional dimension(:):: c

Color scale for bars

real(kind=wp), intent(in), optional :: relWidth

Relative width of bars

character(len=*), intent(in), optional :: fillColor

Color of bar fills

character(len=*), intent(in), optional :: fillPattern

Pattern of bar fills

character(len=*), intent(in), optional :: lineColor

Color of lines around bars

real(kind=wp) , optional :: lineWidth

Width of lines around bars

Description

Create a horizontal bar graph

public subroutine fillBetween(x, y1, y0, fillColor, fillPattern, lineWidth)

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(:):: x
real(kind=wp), intent(in), dimension(:):: y1
real(kind=wp), intent(in), optional dimension(:):: y0
character(len=*), intent(in), optional :: fillColor
character(len=*), intent(in), optional :: fillPattern
real(kind=wp), intent(in), optional :: lineWidth

Description

Fill space between two lines

public subroutine fillBetweenx(y, x1, x0, fillColor, fillPattern, lineWidth)

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(:):: y
real(kind=wp), intent(in), dimension(:):: x1
real(kind=wp), intent(in), optional dimension(:):: x0
character(len=*), intent(in), optional :: fillColor
character(len=*), intent(in), optional :: fillPattern
real(kind=wp), intent(in), optional :: lineWidth

Description

Fill space between two lines

public subroutine errorbar(x, y, xerr, yerr, lineColor, lineStyle, lineWidth)

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(:):: x

x-data for plot

real(kind=wp), intent(in), dimension(:):: y

y-data for plot

real(kind=wp), intent(in), optional dimension(:):: xerr

x-data error for plot

real(kind=wp), intent(in), optional dimension(:):: yerr

y-data error for plot

character(len=*), intent(in), optional :: lineColor

Color of line

character(len=*), intent(in), optional :: lineStyle

Style of line; '' for no line

real(kind=wp), intent(in), optional :: lineWidth

Width of line

Description

Plot error bars for a set of data points

public subroutine setup(device, fileName, fontScaling, whiteOnBlack, transparent, colormap, figSize)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in), optional :: device

Output device to use

character(len=*), intent(in), optional :: fileName

Name of file(s) to write to

real(kind=wp), intent(in), optional :: fontScaling

Font scaling relative to default value

logical, intent(in), optional :: whiteOnBlack

Default foreground and background colors

logical, intent(in), optional :: transparent

Transparent background

character(len=*), intent(in), optional :: colormap

Colormap to use

integer, intent(in), optional dimension(2):: figSize

Size of figures to produce in pixels

Description

Setup PlPlot library, optionally overriding defaults

public subroutine show()

Arguments

None

Description

Show the plots end finialize the PlPlot library