get_legend_margins Function

public function get_legend_margins(data_width, data_height, pixel_plot_width, pixel_plot_height) result(margins)

Inset between the legend box and the axes frame. Matches matplotlib's borderaxespad default (0.5 * 10pt font = 5pt), which at the standard ~100 dpi is ~7 px, independent of the data range. A fixed pixel inset keeps the legend flush in the corner the way matplotlib draws it, instead of a large data-proportional gap.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: data_width
real(kind=wp), intent(in) :: data_height
integer, intent(in), optional :: pixel_plot_width
integer, intent(in), optional :: pixel_plot_height

Return Value real(kind=wp), (2)