fortplot Module

Top-level public interface for fortplot - Modern Fortran plotting library

This module serves as a thin facade that re-exports the complete fortplot API. It delegates all functionality to specialized modules while maintaining full backward compatibility with existing code.

= Architecture = This module is organized as a facade pattern, delegating to: - fortplot_matplotlib: Matplotlib-compatible pyplot-style functions - fortplot_global: Global figure instance management - fortplot_figure_core: Core figure type and constants - fortplot_animation: Animation framework - fortplot_validation: Testing utilities - fortplot_colors: Color handling - fortplot_contour_regions: Contour extraction - fortplot_logging: Logging functionality

= Key Types = - figure_t: Main plotting canvas for creating and managing plots - animation_t: Animation framework for dynamic visualizations
- color_t: Advanced color handling with matplotlib syntax support - validation_result_t: Testing utilities for plot output validation

= Core Plot Types = - Line plots: plot(), add_plot() - Basic line and scatter plotting - Contour plots: contour(), contour_filled() - 2D field visualization - Heat maps: pcolormesh() - Pseudocolor mesh plots - Vector fields: streamplot() - Flow visualization with streamlines - Statistical: hist(), boxplot(), errorbar() - Data distribution plots - 3D plots: add_3d_plot(), add_surface() - Three-dimensional visualization

= Output Backends = - PNG: High-quality raster graphics for publications - PDF: Vector graphics for scalable documents - ASCII: Terminal-based plots for remote/headless environments

= Quick Start Examples = ! Simple line plot use fortplot call plot(x_data, y_data, label="measurements") call show()

! Advanced figure with multiple plots type(figure_t) :: fig call fig%initialize(800, 600) call figure_add_plot(fig, x, y, label="data", linestyle='b-o') call figure_add_contour(fig, x_grid, y_grid, z_field) call figure_legend(fig, ) call figure_savefig(fig, 'results.pdf')

Author: fortplot contributors

Solid line style for continuous data visualization Usage: call plot(x, y, linestyle=LINESTYLE_SOLID) Visual: ————————————————————



Variables

Type Visibility Attributes Name Initial
character(len=*), public, parameter :: LINESTYLE_SOLID = '-'

Dashed line style for highlighting trends or secondary data Usage: call plot(x, y, linestyle=LINESTYLE_DASHED) Visual: ---- ---- ---- ----

character(len=*), public, parameter :: LINESTYLE_DASHED = '--'

Dotted line style for reference lines or uncertainty bounds Usage: call plot(x, y, linestyle=LINESTYLE_DOTTED) Visual: ••••••••••••••••••••

character(len=*), public, parameter :: LINESTYLE_DOTTED = ':'

Dash-dot line style for mixed emphasis visualization Usage: call plot(x, y, linestyle=LINESTYLE_DASHDOT) Visual: ——•——•——•——•

character(len=*), public, parameter :: LINESTYLE_DASHDOT = '-.'

No line style - displays only markers without connecting lines Usage: call plot(x, y, linestyle=LINESTYLE_NONE) Visual: • • • • (markers only)

character(len=*), public, parameter :: LINESTYLE_NONE = 'None'

Circular markers for standard data point visualization Usage: call scatter(x, y, marker=MARKER_CIRCLE) Visual: ● (filled circle)

character(len=*), public, parameter :: MARKER_CIRCLE = 'o'

Cross-shaped markers for outliers or special data points Usage: call scatter(x, y, marker=MARKER_CROSS)
Visual: ✕ (diagonal cross)

character(len=*), public, parameter :: MARKER_CROSS = 'x'

Square markers for categorical or discrete data visualization Usage: call scatter(x, y, marker=MARKER_SQUARE) Visual: ■ (filled square)

character(len=*), public, parameter :: MARKER_SQUARE = 's'

Diamond-shaped markers for highlighting key data points Usage: call scatter(x, y, marker=MARKER_DIAMOND) Visual: ♦ (filled diamond)

character(len=*), public, parameter :: MARKER_DIAMOND = 'D'

Plus-sign markers for positive values or additive data Usage: call scatter(x, y, marker=MARKER_PLUS) Visual: + (orthogonal plus)

character(len=*), public, parameter :: MARKER_PLUS = '+'

Star-shaped markers for exceptional or peak values Usage: call scatter(x, y, marker=MARKER_STAR) Visual: ★ (filled star)

character(len=*), public, parameter :: MARKER_STAR = '*'

Upward triangle markers for increasing trends or maxima Usage: call scatter(x, y, marker=MARKER_TRIANGLE_UP) Visual: ▲ (filled upward triangle)

character(len=*), public, parameter :: MARKER_TRIANGLE_UP = '^'

Downward triangle markers for decreasing trends or minima Usage: call scatter(x, y, marker=MARKER_TRIANGLE_DOWN) Visual: ▼ (filled downward triangle)

character(len=*), public, parameter :: MARKER_TRIANGLE_DOWN = 'v'

Pentagon-shaped markers for specialized scientific data Usage: call scatter(x, y, marker=MARKER_PENTAGON) Visual: ⬟ (filled pentagon)

character(len=*), public, parameter :: MARKER_PENTAGON = 'p'

Hexagon-shaped markers for crystallographic or geometric data Usage: call scatter(x, y, marker=MARKER_HEXAGON) Visual: ⬢ (filled hexagon)

character(len=*), public, parameter :: MARKER_HEXAGON = 'h'