Skip to content

Commit f5ea42f

Browse files
author
Gorshanov Vadim
committed
Use 'every-n-dot' only in larger datasets
1 parent 0debea7 commit f5ea42f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/tikzplotlib/_line2d.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,15 @@ def _table(obj, data): # noqa: C901
273273
if "unbounded coords=jump" not in data["current axes"].axis_options:
274274
data["current axes"].axis_options.append("unbounded coords=jump")
275275

276-
plot_table = [
277-
f"{x:{xformat}}{col_sep}{y:{ff}}{table_row_sep}" for x, y in zip(
278-
xdata[::data["every n dot"]], ydata[::data["every n dot"]])
279-
]
276+
if len(xdata) > data["every n dot"]:
277+
plot_table = [
278+
f"{x:{xformat}}{col_sep}{y:{ff}}{table_row_sep}" for x, y in zip(
279+
xdata[::data["every n dot"]],
280+
ydata[::data["every n dot"]])]
281+
else:
282+
plot_table = [
283+
f"{x:{xformat}}{col_sep}{y:{ff}}{table_row_sep}" for x, y in zip(xdata, ydata)]
284+
280285

281286
min_extern_length = 3
282287

0 commit comments

Comments
 (0)