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 450712b commit d0efbe2Copy full SHA for d0efbe2
src/tikzplotlib/_legend.py
@@ -78,8 +78,13 @@ def draw_legend(data, obj):
78
if alignment:
79
data["current axes"].axis_options.append(f"legend cell align={{{alignment}}}")
80
81
- if obj._ncol != 1:
82
- data["current axes"].axis_options.append(f"legend columns={obj._ncol}")
+ try:
+ ncols = obj._ncols
83
+ except AttributeError:
84
+ # backwards-compatibility with matplotlib < 3.6.0
85
+ ncols = obj._ncol
86
+ if ncols != 1:
87
+ data["current axes"].axis_options.append(f"legend columns={ncols}")
88
89
# Write styles to data
90
if legend_style:
0 commit comments