Skip to content

MNT: Minor cleanup of label formatting in PathCollection.legend_elements#31412

Open
timhoffm wants to merge 1 commit intomatplotlib:mainfrom
timhoffm:mnt-refactor-pathcollection-legend_elements
Open

MNT: Minor cleanup of label formatting in PathCollection.legend_elements#31412
timhoffm wants to merge 1 commit intomatplotlib:mainfrom
timhoffm:mnt-refactor-pathcollection-legend_elements

Conversation

@timhoffm
Copy link
Copy Markdown
Member

This pulls the label formatting out of the loop, so that we don't have to do set_locs() for every label.

Note that fmt is a Formatter and thus always has set_locs().

As written in the note, I would like to simplify to fmt.format_ticks(label_values), but that has subtly different semantics, e.g. in possibly considering an offsetText. Such a change would require a deeper understanding of the formatter logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants