Resolve matplotlib 'best' legend placement against the plotted artists.
Single Responsibility: collect artist sample points in data coordinates and delegate corner selection to fortplot_legend_layout. Kept separate from rendering so the layout module stays free of plot_data_t.
If the legend is in 'best' mode, pick the lowest-overlap corner and pin the legend to it. Coordinates passed to the scorer are relative to the data window origin (x_min, y_min), matching the layout module.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(legend_t), | intent(inout) | :: | legend | |||
| type(plot_data_t), | intent(in) | :: | plots(:) | |||
| integer, | intent(in) | :: | plot_count | |||
| real(kind=wp), | intent(in) | :: | x_min | |||
| real(kind=wp), | intent(in) | :: | x_max | |||
| real(kind=wp), | intent(in) | :: | y_min | |||
| real(kind=wp), | intent(in) | :: | y_max | |||
| integer, | intent(in) | :: | pixel_plot_width | |||
| integer, | intent(in) | :: | pixel_plot_height |