Skip to content

Commit 8fec937

Browse files
committed
fix for draw options
1 parent 330873f commit 8fec937

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tikzplotlib/_path.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,12 @@ def draw_pathcollection(data, obj):
262262
]
263263
)
264264

265-
do = " [{}]".format(", ".join(draw_options)) if draw_options else ""
265+
# remove duplicates
266+
draw_options = sorted(list(set(draw_options)))
267+
268+
len_row = sum(len(item) for item in draw_options)
269+
j0, j1 = ("", ", ") if len_row < 80 else ("\n", ",\n")
270+
do = f" [{j0}{{}}{j0}]".format(j1.join(draw_options)) if draw_options else ""
266271
content.append(f"\\addplot{do}\n")
267272

268273
to = " [{}]".format(", ".join(table_options)) if table_options else ""

0 commit comments

Comments
 (0)