We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f5afdf commit 21061b0Copy full SHA for 21061b0
src/tikzplotlib/_legend.py
@@ -64,8 +64,8 @@ def draw_legend(data, obj):
64
65
mark_options = []
66
handles = obj.legendHandles if hasattr(obj, "legendHandles") else obj.legend_handles if hasattr(obj, "legend_handles") else None
67
- if handles:
68
- all_sizes = set(sz for handle in handles for sz in handle._sizes)
+ if handles and any(hasattr(handle, "_sizes") for handle in handles):
+ all_sizes = set(sz for handle in handles for sz in handle._sizes if hasattr(handle, "_sizes"))
69
if len(all_sizes) > 1:
70
warnings.warn(f"Varying marker sizes in the legend: {all_sizes}. Ignoring all of them.")
71
elif all_sizes:
0 commit comments