fortplot_legend_drawing Module

Legend drawing and rendering procedures

Single Responsibility: Legend box drawing, entry rendering, and positioning



Functions

public pure function backend_is_ascii(backend)

Detect whether backend is operating in ASCII mode based on canvas size

Arguments

Type IntentOptional Attributes Name
class(plot_context), intent(in) :: backend

Return Value logical


Subroutines

public subroutine render_ascii_legend(legend, backend, legend_x, legend_y)

Render compact ASCII legend with proper formatting

Arguments

Type IntentOptional Attributes Name
type(legend_t), intent(in) :: legend
class(plot_context), intent(inout) :: backend
real(kind=wp), intent(in) :: legend_x
real(kind=wp), intent(in) :: legend_y

public subroutine render_standard_legend(legend, backend, legend_x, legend_y)

Render standard legend for PNG/PDF backends with improved sizing

Arguments

Type IntentOptional Attributes Name
type(legend_t), intent(in) :: legend
class(plot_context), intent(inout) :: backend
real(kind=wp), intent(in) :: legend_x
real(kind=wp), intent(in) :: legend_y

public subroutine calculate_legend_position(legend, backend, x, y)

Calculate legend position based on backend and position setting

Arguments

Type IntentOptional Attributes Name
type(legend_t), intent(in) :: legend
class(plot_context), intent(in) :: backend
real(kind=wp), intent(out) :: x
real(kind=wp), intent(out) :: y