calculate_legend_box Function

public function calculate_legend_box(labels, data_width, data_height, num_entries, position, pixel_plot_width, pixel_plot_height) result(box)

Calculate optimal legend box dimensions and position DRY: Centralized legend box calculation logic

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: labels(:)
real(kind=wp), intent(in) :: data_width
real(kind=wp), intent(in) :: data_height
integer, intent(in) :: num_entries
integer, intent(in) :: position
integer, intent(in), optional :: pixel_plot_width
integer, intent(in), optional :: pixel_plot_height

Return Value type(legend_box_t)