fortplot_python_interface Module

Python interface module for F2PY binding generation

This module provides a clean interface for Python bindings using F2PY. It exposes the essential functions needed for simplified Python show() API.

Key functions: - show_figure(blocking): Direct call to Fortran show with blocking parameter - show_viewer(blocking): Direct call to Fortran show_viewer with blocking parameter - All other plotting functions for complete API coverage



Subroutines

public subroutine show_figure(blocking)

Python-accessible show_figure function with optional blocking This replaces the temp file + webbrowser approach with direct Fortran call

Read more…

Arguments

Type IntentOptional Attributes Name
logical, intent(in), optional :: blocking

public subroutine show_viewer(blocking)

Python-accessible show_viewer function with optional blocking Forces display in system viewer regardless of GUI availability

Read more…

Arguments

Type IntentOptional Attributes Name
logical, intent(in), optional :: blocking

public subroutine figure(width, height)

Python-accessible figure initialization

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in), optional :: width
integer, intent(in), optional :: height

public subroutine plot(x, y, n, label, linestyle)

Python-accessible plot function for line plots

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(n) :: x
real(kind=wp), intent(in), dimension(n) :: y
integer, intent(in) :: n
character(len=*), intent(in), optional :: label
character(len=*), intent(in), optional :: linestyle

public subroutine savefig(filename)

Python-accessible savefig function

Read more…

Arguments

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

public subroutine title(text)

Python-accessible title function

Arguments

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

public subroutine xlabel(text)

Python-accessible xlabel function

Arguments

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

public subroutine ylabel(text)

Python-accessible ylabel function

Arguments

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

public subroutine contour(x, y, z, nx, ny, levels, nlevels)

Python-accessible contour function

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(nx) :: x
real(kind=wp), intent(in), dimension(ny) :: y
real(kind=wp), intent(in), dimension(nx, ny) :: z
integer, intent(in) :: nx
integer, intent(in) :: ny
real(kind=wp), intent(in), optional, dimension(:) :: levels
integer, intent(in), optional :: nlevels

public subroutine contour_filled(x, y, z, nx, ny, levels, nlevels, colormap)

Python-accessible filled contour function

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(nx) :: x
real(kind=wp), intent(in), dimension(ny) :: y
real(kind=wp), intent(in), dimension(nx, ny) :: z
integer, intent(in) :: nx
integer, intent(in) :: ny
real(kind=wp), intent(in), optional, dimension(:) :: levels
integer, intent(in), optional :: nlevels
character(len=*), intent(in), optional :: colormap

public subroutine pcolormesh(x, y, c, nx, ny, colormap, vmin, vmax, edgecolors, linewidths)

Python-accessible pcolormesh function

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(nx) :: x
real(kind=wp), intent(in), dimension(ny) :: y
real(kind=wp), intent(in), dimension(nx, ny) :: c
integer, intent(in) :: nx
integer, intent(in) :: ny
character(len=*), intent(in), optional :: colormap
real(kind=wp), intent(in), optional :: vmin
real(kind=wp), intent(in), optional :: vmax
character(len=*), intent(in), optional :: edgecolors
real(kind=wp), intent(in), optional :: linewidths

public subroutine streamplot(x, y, u, v, nx, ny, density, arrowsize, arrowstyle)

Python-accessible streamplot function with arrow support

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(nx) :: x
real(kind=wp), intent(in), dimension(ny) :: y
real(kind=wp), intent(in), dimension(nx, ny) :: u
real(kind=wp), intent(in), dimension(nx, ny) :: v
integer, intent(in) :: nx
integer, intent(in) :: ny
real(kind=wp), intent(in), optional :: density
real(kind=wp), intent(in), optional :: arrowsize
character(len=*), intent(in), optional :: arrowstyle

public subroutine legend()

Python-accessible legend function

Arguments

None

public subroutine set_xscale(scale)

Python-accessible x-axis scale function

Arguments

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

public subroutine set_yscale(scale)

Python-accessible y-axis scale function

Arguments

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

public subroutine xlim(xmin, xmax)

Python-accessible x-axis limits function

Arguments

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

public subroutine ylim(ymin, ymax)

Python-accessible y-axis limits function

Arguments

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

public subroutine scatter(x, y, n, s, c, label, marker, markersize, color, colormap, vmin, vmax, show_colorbar)

Python-accessible scatter plot function

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(n) :: x
real(kind=wp), intent(in), dimension(n) :: y
integer, intent(in) :: n
real(kind=wp), intent(in), optional, dimension(:) :: s
real(kind=wp), intent(in), optional, dimension(:) :: c
character(len=*), intent(in), optional :: label
character(len=*), intent(in), optional :: marker
real(kind=wp), intent(in), optional :: markersize
real(kind=wp), intent(in), optional, dimension(3) :: color
character(len=*), intent(in), optional :: colormap
real(kind=wp), intent(in), optional :: vmin
real(kind=wp), intent(in), optional :: vmax
logical, intent(in), optional :: show_colorbar

public subroutine histogram(data, n, bins, density, label, color)

Python-accessible histogram function

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(n) :: data
integer, intent(in) :: n
integer, intent(in), optional :: bins
logical, intent(in), optional :: density
character(len=*), intent(in), optional :: label
real(kind=wp), intent(in), optional, dimension(3) :: color