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.
Asked
Active
Viewed 3,118 times
1
Wathiq Zayed
- 323
- 5
- 12
2 Answers
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}

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
stackengineapproach: 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