I would like to center the graphics included inside a tikzpicture independent from the additional drawings (like text on the left side of a picture). Currently I am using
% Color RecPos_leftbottom RecPos_righttop Text TextPos
\newcommand{\picelement}[5]{
\node [anchor=east] (cam) at (#5) {\Large #4};
\draw[#1,ultra thick,rounded corners] (#2) rectangle (#3);
\draw [-latex, ultra thick, #1] (cam) to[out=0, in=-120] (#2);
}
\begin{figure}
\centering
\begin{tikzpicture}
\node[anchor=north west,inner sep=0] (image) at (0,0) {\includegraphics[width=0.7\textwidth]{duckiebot.jpg}};
\begin{scope}[x={(image.north east)},y={(image.south west)}]
% Camera
\picelement{green}{0.63,0.5}{0.8,0.37}{Sensing}{-0.1,0.4};
% LEDS
\picelement{yellow}{0.395,0.64}{0.48,0.57}{Communication}{-0.1,0.6};
% Raspi
\picelement{blue}{0.35,0.5}{0.61,0.33}{Computation}{-0.1,0.5};
\end{scope}
\end{tikzpicture}
\caption{A Duckiebot.}
\label{fig:duckiebot}
\end{figure}
And I am obtaining a shifted picture:
Unfortunately, I am unable to find the answer in the forums. How is this possible?


\begin{tikzpicture}[trim left=(image.west)]? – percusse Apr 28 '18 at 10:49