Skip to content

Commit ceb794c

Browse files
authored
Merge pull request #20956 from anntzer/lhu
Make warning for no-handles legend more explicit.
2 parents 6d56592 + fc7bc44 commit ceb794c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/legend.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,10 @@ def _parse_legend_args(axs, *args, handles=None, labels=None, **kwargs):
12241224
elif len(args) == 0:
12251225
handles, labels = _get_legend_handles_labels(axs, handlers)
12261226
if not handles:
1227-
log.warning('No handles with labels found to put in legend.')
1227+
log.warning(
1228+
"No artists with labels found to put in legend. Note that "
1229+
"artists whose label start with an underscore are ignored "
1230+
"when legend() is called with no argument.")
12281231

12291232
# One argument. User defined labels - automatic handle detection.
12301233
elif len(args) == 1:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy