Skip to content

Commit 6882780

Browse files
committed
re-ordered the list of artists returned by legend_handler.HandlerErrorbar
1 parent 60eace2 commit 6882780

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Change artist associated with error bar in legend
2+
`````````````````````````````````````````````````
3+
4+
Changed the order of the artist list returned by
5+
`legend_handler.HandlerErrorbar.create_artists` so that the artist
6+
associated with the legend marker in `legend.legendHandles` is the
7+
`Line2D` object for the markers not the `LineCollection` object for
8+
the error bars.

lib/matplotlib/legend_handler.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -486,10 +486,10 @@ def create_artists(self, legend, orig_handle,
486486
handle_caplines.append(capline_right)
487487

488488
artists = []
489+
artists.append(legline_marker)
489490
artists.extend(handle_barlinecols)
490491
artists.extend(handle_caplines)
491492
artists.append(legline)
492-
artists.append(legline_marker)
493493

494494
for artist in artists:
495495
artist.set_transform(trans)

0 commit comments

Comments
 (0)