3

I want to insert a picture into a TikZ graphic, is it possible?

An example:

diagram

  • 3
    \node at (0,0) {\includegraphics[width=2cm]{your picture}}; Change postion (0,0) and width. You can also do it with pgfplots. – user11232 Aug 11 '14 at 0:34
  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – cfr Aug 11 '14 at 0:43
  • related: tex.stackexchange.com/questions/115087/… – jub0bs Aug 11 '14 at 16:42
2

You can do it with pgfplots. Here is an example:

\documentclass{article}
\usepackage{pgfplots,siunitx}
\pgfplotsset{width=7cm,compat=1.10}
\begin{document}
  \begin{tikzpicture}
    \begin{axis}[enlargelimits=false,axis on top,xlabel = Displacement
                   (\si{\milli\meter}), ylabel = Load (\si{\kilo\newton})]
       \addplot graphics
       [xmin=0,xmax=8,ymin=0,ymax=90]
       {example-image-a};
    \end{axis}
\end{tikzpicture}
\end{document}

enter image description here

  • May be it is better to plot it using pgfplots – user11232 Aug 11 '14 at 1:02
1

it works better with: \node at (0,0) {\includegraphics[width=2cm]{your picture}};

enter image description here

  • 3
    Welcome to TeX.SX! A "fuller" MWE would probably make your answer more helpful to future visitors. – moewe Aug 11 '14 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.