0

I have a plot generated from tikzplotlib & pythontex that I'm working on in a standalone document, to include in a larger document. The offset is present in both documents, and I do not know why. tikzplotlib gives this as output:

\begin{tikzpicture}

\definecolor{color0}{rgb}{0.12156862745098,0.466666666666667,0.705882352941177}
%more colours

\begin{axis}[
legend cell align={left},
legend style={
  fill opacity=0.8,
  draw opacity=1,
  text opacity=1,
  at={(0.91,0.5)},
  anchor=east,
  draw=white!80!black
},
tick align=outside,
tick pos=left,
title={Capacité d'un condensateur de 10 µF},
x grid style={white!69.0196078431373!black},
xlabel={V [V]},
xmin=-0.1534, xmax=3.2214,
xtick style={color=black},
y grid style={white!69.0196078431373!black},
ylabel={C [µF]},
ymin=5.1385, ymax=9.3515,
ytick style={color=black}
]
\addplot [semithick, color0]
table {%
0.00999999046325684 9.14999961853027
0.409999966621399 9.14999961853027
0.63700008392334 9.14000034332275
1.01400005817413 9.14000034332275
1.20700001716614 9.14999961853027
2.59299993515015 9.14999961853027
3.05299997329712 9.15999984741211
};
\addlegendentry{f=0.4kHz}
%more plots
\end{axis}
\end{tikzpicture}

& I include it in this document:

\documentclass[tikz]{standalone}

% Paquets ici.
\usepackage{pythontex}
\usepackage{pgfplots}

\usepgfplotslibrary{groupplots,dateplot}
\usetikzlibrary{patterns,shapes.arrows}
\pgfplotsset{compat=newest}

\begin{document}
\begin{pycode}
# Some Python code
\end{pycode}

\begin{tikzpicture}
\input{graphe0_tikz.tex}
\end{tikzpicture}
\end{document}

What could be the problem?

1 Answer 1

1

Turns out I hadn't seen that tikzplotlib puts in the \begin{tikzpicture} ... \end{tikzpicture}, so I was putting a tikzpicture into a tikzpicture. That caused the offset. I removed the outer one, and now everything works fine.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .