I am using matlab2tikz to plot some matlab graphs, turn those to pdf using the standalone document format, and combine them side by side in a latex document. Whenever I predefine fill color with
\definecolor{mycolor1}{rgb}{0.5625,1,0.4375}
the whole plot gets shifted to the right (like this). If I in turn comment the line everything works just fine. Note that I didn't even use the specified mycolor1 in addplot properties, instead I used fill=yellow. The code is, apart from the color definition, in both cases exactly the same.
Any ideas what might be causing this?
Minimal working example:
bucket.tex
\definecolor{mycolor1}{rgb}{0.5625,1,0.4375}
\begin{tikzpicture}
% Axis at [0.13 0.11 0.78 0.81]
\begin{axis}[%
view={0}{90},
width=10cm,
height=10cm,
scale only axis,
xmin=-5, xmax=-1,
ymin=-5, ymax=-1,
hide x axis,
hide y axis]
\addplot [fill=yellow,draw=black,forget plot] coordinates{ (-5,-0.99999897405059)(-3.00088134424625,-1.02)(-4.24,-4.89040515321358)(-5,-0.99999897405059)};
\addplot [fill=yellow,draw=black,forget plot] coordinates{ (-1,-3.00099999987623) (-1.72,-5.00000063103793)(-2.08,-3.87877006628044)(-1,-3.00099999987623)};
\end{axis}
\end{tikzpicture}%
test.tex
\documentclass[]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\input{bucket.tex}
\end{document}
this produces the erroneous file mentioned above, commenting \definecolor produces the correct result.
\begin{document}) and also are you usingpreviewpackage orstandaloneclass? – percusse Oct 15 '12 at 9:38\begin{document}) everything solved itself. Thanks for the help! – vuce Oct 15 '12 at 10:12