Skip to content

Commit 0777045

Browse files
committed
fix access to _ncol
1 parent 450712b commit 0777045

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/tikzplotlib/_legend.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ def draw_legend(data, obj):
7878
if alignment:
7979
data["current axes"].axis_options.append(f"legend cell align={{{alignment}}}")
8080

81-
if obj._ncol != 1:
81+
# if _ncol not present API is more current, contains _ncols
82+
ncols = getattr(obj, "_ncol", obj._ncols)
83+
if ncols != 1:
8284
data["current axes"].axis_options.append(f"legend columns={obj._ncol}")
8385

8486
# Write styles to data

0 commit comments

Comments
 (0)