Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 074425f

Browse files
committed
Axes._get_legend_handles skips artists whose label is '_nolegend_'
1 parent 41607be commit 074425f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/matplotlib/axes.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4192,6 +4192,9 @@ def _get_legend_handles(self):
41924192
if isinstance(c, mcoll.RegularPolyCollection)])
41934193
handles.extend([c for c in self.collections
41944194
if isinstance(c, mcoll.CircleCollection)])
4195+
4196+
handles = [h for h in handles if h.get_label() != "_nolegend_"]
4197+
41954198
return handles
41964199

41974200

0 commit comments

Comments
 (0)