Calculate optimal legend box dimensions and position DRY: Centralized legend box calculation logic
| Type | Intent | Optional | 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 |