fortplot_matplotlib_plots Module

Matplotlib-compatible plot functions for imshow/pie/polar/step/stem/fill.

Color kwargs accept either a named color string or an RGB triple via generic interfaces. fill_between makes y1 required to match matplotlib's contract. fill accepts an optional step stage to mirror matplotlib's stair-fill mode.



Interfaces

public interface polar

  • private subroutine polar_string(theta, r, fmt, label, linestyle, marker, color)

    Parameters theta - angular samples. r - radial samples. fmt - format string. label - legend label. linestyle - line style. marker - marker style. color - named color string.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in), contiguous :: theta(:)
    real(kind=wp), intent(in), contiguous :: r(:)
    character(len=*), intent(in), optional :: fmt
    character(len=*), intent(in), optional :: label
    character(len=*), intent(in), optional :: linestyle
    character(len=*), intent(in), optional :: marker
    character(len=*), intent(in), optional :: color
  • private subroutine polar_rgb(theta, r, color, fmt, label, linestyle, marker)

    Parameters theta - angular samples. r - radial samples. color - literal RGB triple. fmt - format string. label - legend label. linestyle - line style. marker - marker style.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in), contiguous :: theta(:)
    real(kind=wp), intent(in), contiguous :: r(:)
    real(kind=wp), intent(in) :: color(3)
    character(len=*), intent(in), optional :: fmt
    character(len=*), intent(in), optional :: label
    character(len=*), intent(in), optional :: linestyle
    character(len=*), intent(in), optional :: marker

public interface step

  • private subroutine step_string(x, y, where, label, linestyle, color, linewidth)

    Parameters x - x coordinates. y - y coordinates. where - step position keyword. label - legend label. linestyle - line style. color - named color string. linewidth - line width.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in), contiguous :: x(:)
    real(kind=wp), intent(in), contiguous :: y(:)
    character(len=*), intent(in), optional :: where
    character(len=*), intent(in), optional :: label
    character(len=*), intent(in), optional :: linestyle
    character(len=*), intent(in), optional :: color
    real(kind=wp), intent(in), optional :: linewidth
  • private subroutine step_rgb(x, y, color, where, label, linestyle, linewidth)

    Parameters x - x coordinates. y - y coordinates. color - literal RGB triple. where - step position keyword. label - legend label. linestyle - line style. linewidth - line width.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in), contiguous :: x(:)
    real(kind=wp), intent(in), contiguous :: y(:)
    real(kind=wp), intent(in) :: color(3)
    character(len=*), intent(in), optional :: where
    character(len=*), intent(in), optional :: label
    character(len=*), intent(in), optional :: linestyle
    real(kind=wp), intent(in), optional :: linewidth

public interface fill

  • private subroutine fill_string(x, y, color, alpha, step)

    Parameters x - x coordinates. y - y coordinates. color - named color string. alpha - fill opacity. step - stair-fill mode.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in), contiguous :: x(:)
    real(kind=wp), intent(in), contiguous :: y(:)
    character(len=*), intent(in) :: color
    real(kind=wp), intent(in), optional :: alpha
    character(len=*), intent(in), optional :: step
  • private subroutine fill_rgb(x, y, color, alpha, step)

    Parameters x - x coordinates. y - y coordinates. color - literal RGB triple. alpha - fill opacity. step - stair-fill mode.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in), contiguous :: x(:)
    real(kind=wp), intent(in), contiguous :: y(:)
    real(kind=wp), intent(in) :: color(3)
    real(kind=wp), intent(in), optional :: alpha
    character(len=*), intent(in), optional :: step
  • private subroutine fill_default(x, y, alpha, step)

    Parameters x - x coordinates. y - y coordinates. alpha - fill opacity. step - stair-fill mode.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in), contiguous :: x(:)
    real(kind=wp), intent(in), contiguous :: y(:)
    real(kind=wp), intent(in), optional :: alpha
    character(len=*), intent(in), optional :: step

public interface fill_between

  • private subroutine fill_between_string(x, y1, y2, where, color, alpha, interpolate, step)

    Parameters x - x coordinates. y1 - lower curve. y2 - upper curve. where - mask for filled spans. color - named color string. alpha - fill opacity. interpolate - interpolate mask edges. step - stair-fill mode.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in), contiguous :: x(:)
    real(kind=wp), intent(in), contiguous :: y1(:)
    real(kind=wp), intent(in), optional :: y2(:)
    logical, intent(in), optional :: where(:)
    character(len=*), intent(in), optional :: color
    real(kind=wp), intent(in), optional :: alpha
    logical, intent(in), optional :: interpolate
    character(len=*), intent(in), optional :: step
  • private subroutine fill_between_rgb(x, y1, y2, where, color, alpha, interpolate, step)

    Parameters x - x coordinates. y1 - lower curve. y2 - upper curve. where - mask for filled spans. color - literal RGB triple. alpha - fill opacity. interpolate - interpolate mask edges. step - stair-fill mode.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in), contiguous :: x(:)
    real(kind=wp), intent(in), contiguous :: y1(:)
    real(kind=wp), intent(in), optional :: y2(:)
    logical, intent(in), optional :: where(:)
    real(kind=wp), intent(in) :: color(3)
    real(kind=wp), intent(in), optional :: alpha
    logical, intent(in), optional :: interpolate
    character(len=*), intent(in), optional :: step

Subroutines

public subroutine imshow(z, cmap, alpha, vmin, vmax, origin, extent, interpolation, aspect)

Parameters z - image data. cmap - colormap name. alpha - opacity. vmin - lower color limit. vmax - upper color limit. origin - array origin keyword. extent - image extent. interpolation - interpolation mode. aspect - aspect keyword.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), contiguous :: z(:,:)
character(len=*), intent(in), optional :: cmap
real(kind=wp), intent(in), optional :: alpha
real(kind=wp), intent(in), optional :: vmin
real(kind=wp), intent(in), optional :: vmax
character(len=*), intent(in), optional :: origin
real(kind=wp), intent(in), optional :: extent(4)
character(len=*), intent(in), optional :: interpolation
character(len=*), intent(in), optional :: aspect

public subroutine pie(values, labels, colors, explode, autopct, startangle)

Parameters values - wedge sizes. labels - wedge labels. colors - wedge colors. explode - wedge offsets. autopct - percentage label format. startangle - rotation angle in degrees.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), contiguous :: values(:)
character(len=*), intent(in), optional :: labels(:)
character(len=*), intent(in), optional :: colors(:)
real(kind=wp), intent(in), optional :: explode(:)
character(len=*), intent(in), optional :: autopct
real(kind=wp), intent(in), optional :: startangle

public subroutine stem(x, y, linefmt, markerfmt, basefmt, label, bottom)

Parameters x - stem positions. y - stem heights. linefmt - line format. markerfmt - marker format. basefmt - base format. label - legend label. bottom - baseline value.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), contiguous :: x(:)
real(kind=wp), intent(in), contiguous :: y(:)
character(len=*), intent(in), optional :: linefmt
character(len=*), intent(in), optional :: markerfmt
character(len=*), intent(in), optional :: basefmt
character(len=*), intent(in), optional :: label
real(kind=wp), intent(in), optional :: bottom

public subroutine twinx()

Parameters None.

Arguments

None

public subroutine twiny()

Parameters None.

Arguments

None