From eb114969f214320b9ef5c282b6b3b3e39c227d1b Mon Sep 17 00:00:00 2001 From: tusharkulkarni008 Date: Sat, 1 Oct 2022 11:54:47 +0530 Subject: [PATCH] #24050 No error was thrown even number of handles mismatched labels user named haferburg. used plot method bunch of times and then called legend. with less handles than labels. program didn't raise any error. now it should raise Value error --- lib/matplotlib/legend.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/matplotlib/legend.py b/lib/matplotlib/legend.py index 20d4a76e0db3..95e542f9f96c 100644 --- a/lib/matplotlib/legend.py +++ b/lib/matplotlib/legend.py @@ -1260,6 +1260,8 @@ def _parse_legend_args(axs, *args, handles=None, labels=None, **kwargs): elif len(args) >= 2: handles, labels = args[:2] extra_args = args[2:] + elif len(handles)!= len(labels): + raise ValueError("fewer handles than labels or vice versa") else: raise TypeError('Invalid arguments to legend.') 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