fortplot_matplotlib_axes Module

Axes, scale, and labelling helpers for the matplotlib facade



Interfaces

public interface axis

Set aspect ratio: axis('equal'), axis('auto'), or axis(2.0)

  • private subroutine axis_str(aspect)

    Set axis aspect ratio using string mode.

    Parameters aspect : character(len=*), intent(in) 'equal' or 'auto'.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: aspect
  • private subroutine axis_num(ratio)

    Set axis aspect ratio using a numeric value.

    Parameters ratio : real(wp), intent(in) y-scale = ratio * x-scale.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in) :: ratio

Functions

public function get_active_axis() result(axis_name)

Return the name of the currently active axes.

Read more…

Arguments

None

Return Value character(len=10)


Subroutines

public subroutine xlabel(label_text)

Set the x-axis label text.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: label_text

public subroutine ylabel(label_text)

Set the y-axis label text.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: label_text

public subroutine title(title_text)

Set the title for the current axes.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: title_text

public subroutine suptitle(title_text, fontsize)

Set a centered figure-level title above all subplots.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: title_text
real(kind=wp), intent(in), optional :: fontsize

public subroutine set_text_charset(charset)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: charset

public subroutine set_text_color_mode(mode)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: mode

public subroutine legend(loc, box, fontsize, position)

Display the figure legend.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in), optional :: loc
logical, intent(in), optional :: box
integer, intent(in), optional :: fontsize
character(len=*), intent(in), optional :: position

public subroutine grid(visible, which, axis, alpha, linestyle, enabled)

Toggle or style grid lines.

Read more…

Arguments

Type IntentOptional Attributes Name
logical, intent(in), optional :: visible
character(len=*), intent(in), optional :: which
character(len=*), intent(in), optional :: axis
real(kind=wp), intent(in), optional :: alpha
character(len=*), intent(in), optional :: linestyle
logical, intent(in), optional :: enabled

public subroutine xlim(xmin, xmax)

Set the x-axis display limits.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: xmin
real(kind=wp), intent(in) :: xmax

public subroutine ylim(ymin, ymax)

Set the y-axis display limits.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: ymin
real(kind=wp), intent(in) :: ymax

public subroutine view_init(elev, azim, dist)

Set the 3D view angles in degrees.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), optional :: elev
real(kind=wp), intent(in), optional :: azim
real(kind=wp), intent(in), optional :: dist

public subroutine set_xscale(scale, linthresh, threshold, base, linscale)

Set the x-axis scale.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: scale
real(kind=wp), intent(in), optional :: linthresh
real(kind=wp), intent(in), optional :: threshold
real(kind=wp), intent(in), optional :: base
real(kind=wp), intent(in), optional :: linscale

public subroutine set_yscale(scale, linthresh, threshold, base, linscale)

Set the y-axis scale.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: scale
real(kind=wp), intent(in), optional :: linthresh
real(kind=wp), intent(in), optional :: threshold
real(kind=wp), intent(in), optional :: base
real(kind=wp), intent(in), optional :: linscale

public subroutine xscale(scale, linthresh, threshold, base, linscale)

Alias for set_xscale.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: scale
real(kind=wp), intent(in), optional :: linthresh
real(kind=wp), intent(in), optional :: threshold
real(kind=wp), intent(in), optional :: base
real(kind=wp), intent(in), optional :: linscale

public subroutine yscale(scale, linthresh, threshold, base, linscale)

Alias for set_yscale.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: scale
real(kind=wp), intent(in), optional :: linthresh
real(kind=wp), intent(in), optional :: threshold
real(kind=wp), intent(in), optional :: base
real(kind=wp), intent(in), optional :: linscale

public subroutine set_line_width(width)

Set the default line width for subsequent plots.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: width

public subroutine set_ydata(ydata)

Replace the y-data of the first plot line.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), contiguous :: ydata(:)

public subroutine use_axis(axis_name)

Switch the active axes by name.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: axis_name

public subroutine minorticks_on()

Enable minor ticks on both axes.

Arguments

None

public subroutine tight_layout(pad, w_pad, h_pad)

Automatically adjust subplot parameters to give specified padding.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), optional :: pad
real(kind=wp), intent(in), optional :: w_pad
real(kind=wp), intent(in), optional :: h_pad

public subroutine axhline(y, xmin, xmax, color, linestyle, linewidth, label)

Draw a horizontal reference line.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: y
real(kind=wp), intent(in), optional :: xmin
real(kind=wp), intent(in), optional :: xmax
character(len=*), intent(in), optional :: color
character(len=*), intent(in), optional :: linestyle
real(kind=wp), intent(in), optional :: linewidth
character(len=*), intent(in), optional :: label

public subroutine axvline(x, ymin, ymax, color, linestyle, linewidth, label)

Draw a vertical reference line.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x
real(kind=wp), intent(in), optional :: ymin
real(kind=wp), intent(in), optional :: ymax
character(len=*), intent(in), optional :: color
character(len=*), intent(in), optional :: linestyle
real(kind=wp), intent(in), optional :: linewidth
character(len=*), intent(in), optional :: label

public subroutine hlines(y, xmin, xmax, colors, linestyles, linewidth, label)

Draw one or more horizontal lines.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), contiguous :: y(:)
real(kind=wp), intent(in) :: xmin
real(kind=wp), intent(in) :: xmax
character(len=*), intent(in), optional :: colors
character(len=*), intent(in), optional :: linestyles
real(kind=wp), intent(in), optional :: linewidth
character(len=*), intent(in), optional :: label

public subroutine vlines(x, ymin, ymax, colors, linestyles, linewidth, label)

Draw one or more vertical lines.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), contiguous :: x(:)
real(kind=wp), intent(in) :: ymin
real(kind=wp), intent(in) :: ymax
character(len=*), intent(in), optional :: colors
character(len=*), intent(in), optional :: linestyles
real(kind=wp), intent(in), optional :: linewidth
character(len=*), intent(in), optional :: label

public subroutine set_xticks(positions, labels)

Set custom x-axis tick positions and optional labels.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), contiguous :: positions(:)
character(len=*), intent(in), optional :: labels(:)

public subroutine set_yticks(positions, labels)

Set custom y-axis tick positions and optional labels.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), contiguous :: positions(:)
character(len=*), intent(in), optional :: labels(:)