1

I have just wanted to know how can I insert a figure or picture on another figure or picture as clarified in attached picture, where the whole gray box represents the main figure while the blue one represents the second figure.inserting picture or figure  on another picture

Wathiq Zayed
  • 323
  • 5
  • 12
  • I think your question can be solved with http://tex.stackexchange.com/questions/20792/how-to-superimpose-latex-on-a-picture or http://tex.stackexchange.com/questions/9559/drawing-on-an-image-with-tikz – Ignasi May 19 '15 at 11:02
  • Here's a stackengine approach: http://tex.stackexchange.com/questions/171483/mathematical-formulas-on-a-graph-not-made-by-tex/171486#171486 – Steven B. Segletes May 19 '15 at 11:53

2 Answers2

1

This can pretty easily be done with TikZ, as @Ignasi suggested in his comment. Obviously you'll have to tweak the widths of the included graphics...

\documentclass{article}
\usepackage{graphicx}
\usepackage{tikz}

\newlength\imagewidth
\newlength\imagescale

\begin{document}

\begin{figure}
    \centering
    \includegraphics[width=0.618\linewidth]{img1}
    \caption{Image 1}
\end{figure}

\begin{figure}
    \centering
    \includegraphics[width=0.309\linewidth]{img2}
    \caption{Image 2}
\end{figure}

\begin{figure}
    \centering
    \pgfmathsetlength{\imagewidth}{\linewidth}%
    \pgfmathsetlength{\imagescale}{\imagewidth/524}%
    \begin{tikzpicture}[x=\imagescale,y=-\imagescale]
        \node[anchor=north west] at (0,0) {\includegraphics[width=\imagewidth]{img1}};
        \node[anchor=north west] at (300,100) {\includegraphics[width=0.25\imagewidth]{img2}};
    \end{tikzpicture}
    \caption{Both images on top of each other}
\end{figure}

\end{document}

enter image description here

Habi
  • 7,694
0

If you prefer, you can do this kind of thing outside of latex easily with imagemagick. The +5+10 part controls the location of figure1 on figure2.

composite -geometry +5+10 figure1.png figure2.png new.png
James
  • 4,587
  • 1
  • 12
  • 27