nschloe/tikzplotlib

Generated scatterplot does not compile

jdegeete opened this issue · 0 comments

I am running into an issue with the generated tikzplotlib code for my scatter plots. I am unsure whether this has to with my python code, the generated tex file or the overarching tex project.

To generated my plot I used the following code:

sns.set_theme(style="whitegrid")
sns.set_style({'font.family': 'serif', 'font.serif': ['Times New Roman']})

font = FontProperties()
font.set_family('serif')
font.set_name('Times New Roman')
font.set_size('16')

x = arange(3.31, 4.295, 0.005)

df = pd.DataFrame()
df['Frequency'] = x
df['Total least squares'] = total_least_squares_results

f, ax = plt.subplots()  # figsize=(8, 8)
sns.scatterplot(x="Frequency", y="value", hue='variable', data=pd.melt(df, ['Frequency']), s=20, linewidth=0, legend=False)
ax.set_xlabel('Frequency [GHz]', fontproperties=font)
ax.set_ylabel('Relative error [dB]', fontproperties=font)
plt.tight_layout()
tikzplotlib.clean_figure()
tikzplotlib.save("./plots/mytikz.tex")

This gives me the following tex file (uploaded as a txt file for convenience): mytikz.txt

I have included this in my .tex project that compiles using pdflatex using overleaf.

\usepackage[utf8]{inputenc}
\usepackage{pgfplots}
\DeclareUnicodeCharacter{2212}{−}
\usepgfplotslibrary{groupplots,dateplot}
\usetikzlibrary{patterns,shapes.arrows}
\pgfplotsset{compat=newest}
\begin{figure}[htbp]
    \centering
    \input{IEEEtran/figures/experiment1/mytikz}
\end{figure}

However, when I try to compile. I get confronted with a number of problems of which I am unsure what is causing it exactly. The output relating the plot: errors.txt