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:


%more colours

legend cell align={left},
legend style={
  fill opacity=0.8,
  draw opacity=1,
  text opacity=1,
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
%more plots

& I include it in this document:


% Paquets ici.


# Some Python code


What could be the problem?

1 Answer 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 .