easy_plplot_m Module

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


Uses

  • module~~easy_plplot_m~~UsesGraph module~easy_plplot_m easy_plplot_m plplot plplot module~easy_plplot_m->plplot module~utilities_m utilities_m module~easy_plplot_m->module~utilities_m iso_fortran_env iso_fortran_env module~easy_plplot_m->iso_fortran_env module~utilities_m->iso_fortran_env

Used by

  • module~~easy_plplot_m~~UsedByGraph module~easy_plplot_m easy_plplot_m program~animate animate program~animate->module~easy_plplot_m program~logo logo program~logo->module~easy_plplot_m program~basic basic program~basic->module~easy_plplot_m program~examples examples program~examples->module~easy_plplot_m

Contents


Functions

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

Count data in each bin

Arguments

TypeIntentOptionalAttributesName
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


Subroutines

public subroutine figure()

Create a new figure

Arguments

None

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

Create a set of axes on a figure

Arguments

TypeIntentOptionalAttributesName
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

public subroutine xylim(xb, yb)

Set the x and y ranges of the plot

Arguments

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

x-range of plot

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

y-range of plot

public subroutine xlim(xl, xh)

Set the limits of the x-axis

Arguments

TypeIntentOptionalAttributesName
real(kind=wp), intent(in) :: xl
real(kind=wp), intent(in) :: xh

public subroutine ylim(yl, yh)

Set the limits of the y-axis

Arguments

TypeIntentOptionalAttributesName
real(kind=wp), intent(in) :: yl
real(kind=wp), intent(in) :: yh

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

Set the limits for a 3d plot

Arguments

TypeIntentOptionalAttributesName
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)

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

Set the ticks for the axes

Arguments

TypeIntentOptionalAttributesName
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, intent(in), optional :: color

Color code for ticks, box, and labels

real(kind=wp), optional :: linewidth

Line width for ticks and box

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

Set x,y and plot labels

Arguments

TypeIntentOptionalAttributesName
character, intent(in) :: xLabel

Label for x-axis

character, intent(in) :: yLabel

Label for x-axis

character, intent(in) :: zLabel

Label for z-axis

character, intent(in), optional :: color

Color of labels

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

Set the ticks for the x-axis

Arguments

TypeIntentOptionalAttributesName
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, intent(in), optional :: color

Color code for ticks, box, and labels

real(kind=wp), optional :: linewidth

Line width for ticks and box

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

Set the ticks for the y-axis

Arguments

TypeIntentOptionalAttributesName
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, intent(in), optional :: color

Color code for ticks, box, and labels

real(kind=wp), optional :: linewidth

Line width for ticks and box

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

Set x,y and plot labels

Arguments

TypeIntentOptionalAttributesName
character, intent(in) :: xLabel

Label for x-axis

character, intent(in) :: yLabel

Label for x-axis

character, intent(in) :: plotLabel

Label entire plot

character, intent(in), optional :: color

Color of labels

public subroutine xlabel(label, color)

Set x-label

Arguments

TypeIntentOptionalAttributesName
character, intent(in) :: label

Label for axis

character, intent(in), optional :: color

Color of labels

public subroutine ylabel(label, color)

Set y-label

Arguments

TypeIntentOptionalAttributesName
character, intent(in) :: label

Label for axis

character, intent(in), optional :: color

Color of labels

public subroutine title(label, color)

Set plot title

Arguments

TypeIntentOptionalAttributesName
character, intent(in) :: label

Label for plot

character, intent(in), optional :: color

Color of labels

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

Add a colorbar to the top of the plot

Arguments

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

Data used for levels computation

integer, intent(in) :: N

Number of levels to compute

character, intent(in), optional :: leftLabel

Label for left side of colorbar

character, intent(in), optional :: rightLabel

Label for right side of colorbar

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

Add a colorbar to the top of the plot

Arguments

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

Data used for levels computation

integer, intent(in) :: N

Number of levels to compute

character, intent(in), optional :: leftLabel

Label for left side of colorbar

character, intent(in), optional :: rightLabel

Label for right side of colorbar

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

Create legend for plot data

Read more…

Arguments

TypeIntentOptionalAttributesName
character, intent(in) :: corner

Corner for legend

character, 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

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

Create a histogram

Arguments

TypeIntentOptionalAttributesName
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, intent(in), optional :: fillColor

Color of bar fills

character, intent(in), optional :: fillPattern

Pattern of bar fills

character, intent(in), optional :: lineColor

Color of lines around bars

real(kind=wp), optional :: lineWidth

Width of lines around bars

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

Create scatter plot of data

Arguments

TypeIntentOptionalAttributesName
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, intent(in), optional :: markColor

Color of markers; overridden by z

character, intent(in), optional :: markStyle

Style of markers

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

Size of markers

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

Plot data using lines and or markers

Arguments

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

x-data for plot

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

y-data for plot

character, intent(in), optional :: lineColor

Color of line

character, intent(in), optional :: lineStyle

Style of line; '' for no line

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

Width of line

character, intent(in), optional :: markColor

Color of markers, if any

character, intent(in), optional :: markStyle

Style of markers; '' or absent for none

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

Size of markers, if any

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

Plot data using lines and or markers

Arguments

TypeIntentOptionalAttributesName
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, intent(in), optional :: lineColor

Color of line

character, intent(in), optional :: lineStyle

Style of line; '' for no line

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

Width of line

character, intent(in), optional :: markColor

Color of markers, if any

character, intent(in), optional :: markStyle

Style of markers; '' or absent for none

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

Size of markers, if any

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

Plot contour lines

Arguments

TypeIntentOptionalAttributesName
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, intent(in), optional :: lineColor

Color of contour lines

character, intent(in), optional :: lineStyle

Style of contour lines

real(kind=wp), optional :: lineWidth

Width of contour lines

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

Plot a 3d surface

Arguments

TypeIntentOptionalAttributesName
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, intent(in), optional :: lineStyle

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

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

Plot a 3d wireframe

Arguments

TypeIntentOptionalAttributesName
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, intent(in), optional :: lineColor

Color of contour lines

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

Plot filled contours

Arguments

TypeIntentOptionalAttributesName
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

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

Plot vectors

Arguments

TypeIntentOptionalAttributesName
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

0 = Directly scaled

character, intent(in), optional :: lineColor

Color of vectors

character, intent(in), optional :: lineStyle

Style of vectors' lines

real(kind=wp), optional :: lineWidth

Width of vectors' lines

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

Create a bar graph

Arguments

TypeIntentOptionalAttributesName
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, intent(in), optional :: fillColor

Color of bar fills

character, intent(in), optional :: fillPattern

Pattern of bar fills

character, intent(in), optional :: lineColor

Color of lines around bars

real(kind=wp), optional :: lineWidth

Width of lines around bars

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

Create a horizontal bar graph

Arguments

TypeIntentOptionalAttributesName
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, intent(in), optional :: fillColor

Color of bar fills

character, intent(in), optional :: fillPattern

Pattern of bar fills

character, intent(in), optional :: lineColor

Color of lines around bars

real(kind=wp), optional :: lineWidth

Width of lines around bars

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

Fill space between two lines

Arguments

TypeIntentOptionalAttributesName
real(kind=wp), intent(in), dimension(:):: x
real(kind=wp), intent(in), dimension(:):: y1
real(kind=wp), intent(in), optional dimension(:):: y0
character, intent(in), optional :: fillColor
character, intent(in), optional :: fillPattern
real(kind=wp), intent(in), optional :: lineWidth

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

Fill space between two lines

Arguments

TypeIntentOptionalAttributesName
real(kind=wp), intent(in), dimension(:):: y
real(kind=wp), intent(in), dimension(:):: x1
real(kind=wp), intent(in), optional dimension(:):: x0
character, intent(in), optional :: fillColor
character, intent(in), optional :: fillPattern
real(kind=wp), intent(in), optional :: lineWidth

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

Plot error bars for a set of data points

Arguments

TypeIntentOptionalAttributesName
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, intent(in), optional :: lineColor

Color of line

character, intent(in), optional :: lineStyle

Style of line; '' for no line

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

Width of line

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

Setup PlPlot library, optionally overriding defaults

Arguments

TypeIntentOptionalAttributesName
character, intent(in), optional :: device

Output device to use

  • qtwidget
  • svgqt
  • pngqt
character, intent(in), optional :: fileName

Name of file(s) to write to

The text %n will be replaced with the figure number

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, intent(in), optional :: colormap

Colormap to use

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

Size of figures to produce in pixels

public subroutine show()

Show the plots end finialize the PlPlot library

Arguments

None