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, artist_paths, rectangles) result(position)

Resolve matplotlib 'best' placement across all ten anchored positions. Score covered vertices, intersecting paths, offsets and patch bounds; ties follow Matplotlib location-code 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
integer, intent(in), optional :: artist_paths(:)
real(kind=wp), intent(in), optional :: rectangles(:,:)

Return Value integer