annotation_demo Program

Uses

Text annotation demonstration for fortplot

This example demonstrates all the key text annotation features: - Basic text placement at specified coordinates - Text annotations with arrows pointing to data points - Font size and color customization - Text rotation support - Background boxes for text - Multiple text alignment options - Different coordinate systems (data, figure, axis)

The example creates a plot with various data features and annotates them to demonstrate scientific figure preparation capabilities.


Variables

Type Attributes Name Initial
integer, parameter :: n = 100
real(kind=wp) :: x(n)
real(kind=wp) :: y_sin(n)
real(kind=wp) :: y_exp(n)
real(kind=wp) :: y_quad(n)
real(kind=wp) :: x_max
real(kind=wp) :: y_max_sin
real(kind=wp) :: x_min
real(kind=wp) :: y_min_exp
integer :: i
integer :: max_idx
integer :: min_idx
type(figure_t) :: fig

Functions

function format_number(value) result(formatted)

Simple number formatting for annotations

Arguments

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

Return Value character(len=16)