From How can I embed an external image within a tikzpicture environment? I can see that \includegraphics can be used within a TikZ environment using \node.
However, my tikzpicture includes an axis environment (from a plot generated in matlab and translated to TikZ) and I wish to position the node based on this axis rather than the picture position.
Is it possible to be done?
Here is simplified version of my code. Right now to position my figure I'm using \node[inner sep=0pt] (test) at (14,10), which from what I understand refers to the figure position, not the axis position.
\begin{tikzpicture}
\begin{axis}[%
xmin=0,
xmax=5,
tick align=outside,
xlabel={x},
ymin=-11,
ymax=0.5,
ylabel={y},
zmin=0,
zmax=20,
zlabel={z},
view={-57.4}{14.4},
axis background/.style={fill=white},
legend style={at={(1.03,1)}, anchor=north west, legend cell align=left, align=left, draw=white!15!black}
]
\addplot3 [color=gray]
table[row sep=crcr] {%
0 0 0\\
4 0.03 17\\
};
\node[inner sep=0pt] (test) at (14,10)
{\includegraphics[width=.25\textwidth]{harmonicfit}};
\end{axis}
\end{tikzpicture}%
transform shape.) – Feb 27 '19 at 15:41