Skip to content

Commit c734ed4

Browse files
committed
ditch newline when inserting tables with data
1 parent b27364c commit c734ed4

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ license = MIT
1515
license_file = LICENSE
1616
classifiers =
1717
Development Status :: 4 - Beta
18+
Framework :: Matplotlib
1819
License :: OSI Approved :: MIT License
1920
Operating System :: OS Independent
2021
Programming Language :: Python

src/tikzplotlib/_line2d.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,12 @@ def _table(obj, data): # noqa: C901
266266
if data["table_row_sep"] != "\n":
267267
# don't want the \n in the table definition, just in the data (below)
268268
opts.append("row sep=" + data["table_row_sep"].strip())
269+
269270
if len(opts) > 0:
270-
content.append("table [{}] {{%\n".format(",".join(opts)))
271+
opts_str = ",".join(opts)
272+
content.append(f"table [{opts_str}] {{")
271273
else:
272-
content.append("table {%\n")
274+
content.append("table {")
273275

274276
plot_table = []
275277
table_row_sep = data["table_row_sep"]
@@ -290,6 +292,7 @@ def _table(obj, data): # noqa: C901
290292
f.write("".join(plot_table))
291293
content.append(str(rel_filepath))
292294
else:
295+
content.append("%\n")
293296
content.extend(plot_table)
294297

295298
content.append("};\n")

0 commit comments

Comments
 (0)