choose_best_legend_position Function

public function choose_best_legend_position(labels, data_width, data_height, num_entries, artist_x, artist_y, pixel_plot_width, pixel_plot_height) result(position)

Resolve matplotlib 'best' placement to a concrete corner. Computes the legend box for each candidate corner and scores it by the number of plotted artist sample points its bbox covers; the lowest overlap wins, ties broken in matplotlib's order (upper right first).

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
real(kind=wp), intent(in) :: artist_x(:)
real(kind=wp), intent(in) :: artist_y(:)
integer, intent(in), optional :: pixel_plot_width
integer, intent(in), optional :: pixel_plot_height

Return Value integer