1

I am currently having some issues creating diagrams for LaTex using tikzplotlib in python. The string created with tikzplotlib contains characters that cannot be processed by latex. Here is a sample output from tikzplotlib:

\addplot [draw=black, fill=black, mark=triangle*, only marks]
table{%
x  y
1.5119477038458 0.180442876474926
1.44636642995582 0.169285416434582
2.07949490561258 0.166607028235632
2.38414607458506 0.163412604913265
2.52769892999747 0.131844412849406
2.72881787124973 0.131355140919649
4.19434644217454 0.128581079999844
5.04979349560212 0.113004047738612
6.0271636658133 0.100431238264006
6.43968562783207 0.0712910997922297
-- --
-- --
-- --
-- --
-- --

When compiling the document in LaTex, the following error code appears:

Package PGF Math Error: Could not parse input '--' as a floating point number, sorry. The unreadable part was near '-'.. };

Is there any way to remove the '--' or change it to nan? Here is my code for the export:

pgfplotsset = {'compat=newest', 'mark size = 1.73'}


tikzplotlib.save(r'C:\Users\...\mytikz.tex',
                 encoding='utf8', axis_height='7.03cm', axis_width='9.34cm', textsize=10.0,
                 extra_axis_parameters=pgfplotsset, strict=True)

Since this is my first post here, I apologize for possible formatting errors :)

I have already tried to change the characters in the string after its creation. I hope there is an easier option.

Hendrik
  • 11
  • 1

0 Answers0