From f8536e6d0de4816af29dae9e52bab86acf3dc617 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Wed, 1 Sep 2021 04:59:36 +0200 Subject: [PATCH] Backport PR #20956: Make warning for no-handles legend more explicit. --- lib/matplotlib/legend.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/legend.py b/lib/matplotlib/legend.py index 1d85ba1a3f27..6d956a29ee48 100644 --- a/lib/matplotlib/legend.py +++ b/lib/matplotlib/legend.py @@ -1224,7 +1224,10 @@ def _parse_legend_args(axs, *args, handles=None, labels=None, **kwargs): elif len(args) == 0: handles, labels = _get_legend_handles_labels(axs, handlers) if not handles: - log.warning('No handles with labels found to put in legend.') + log.warning( + "No artists with labels found to put in legend. Note that " + "artists whose label start with an underscore are ignored " + "when legend() is called with no argument.") # One argument. User defined labels - automatic handle detection. elif len(args) == 1:
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: