Skip to content

re-ordered the list of artists returned by legend_handler.HandlerErrorbar #2532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions doc/api/api_changes/2013-10_errorbar_legendhandler_order.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Change artist associated with error bar in legend
`````````````````````````````````````````````````

Changed the order of the artist list returned by
`legend_handler.HandlerErrorbar.create_artists` so that the artist
associated with the legend marker in `legend.legendHandles` is the
`Line2D` object for the markers not the `LineCollection` object for
the error bars.
2 changes: 1 addition & 1 deletion lib/matplotlib/legend_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,10 +486,10 @@ def create_artists(self, legend, orig_handle,
handle_caplines.append(capline_right)

artists = []
artists.append(legline_marker)
artists.extend(handle_barlinecols)
artists.extend(handle_caplines)
artists.append(legline)
artists.append(legline_marker)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this result in 2 newlines? (its hard to tell with github). If so, would you mind removing one of them?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, I also pep8'd the entire file while I was at it.

for artist in artists:
artist.set_transform(trans)
Expand Down