From 2e19ca5b056e0082e517499db17da22a3b410d1d Mon Sep 17 00:00:00 2001 From: Jason Gross Date: Wed, 22 May 2024 11:45:44 -0700 Subject: [PATCH] Update _util.py working around a bug --- src/tikzplotlib/_util.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tikzplotlib/_util.py b/src/tikzplotlib/_util.py index 8391221c..ffe7a18d 100644 --- a/src/tikzplotlib/_util.py +++ b/src/tikzplotlib/_util.py @@ -12,7 +12,10 @@ def get_legend_text(obj): if leg is None: return None - keys = [h.get_label() for h in leg.legendHandles if h is not None] + try: + keys = [h.get_label() for h in leg.legendHandles if h is not None] + except AttributeError: + keys = [h.get_label() for h in leg.legend_handles if h is not None] values = [t.get_text() for t in leg.texts] label = obj.get_label()