# Positioning a figure inside a figure environment

I have a tricky problem: Imagine two graphs in a figure environment and each in a minipage so that each graph gets half of the textlength. Now I realised that I need to put on the right side of each graph another graph, which should be of the same height as the existing ones. So we have 2 graphs with a "side-graph" each. Each graph and side-graph have their own caption. I accomplished that by writing \includegraphics[]{graph} \includegraphics[]{side-graph} \caption{} ... you will see in the code. My problem now is that the side-graph is initially positioned on the side AND bottom of the graph. Placing a \vspace{-2cm} etc. does not help, as this applies to both, the graph and side-graph and so both are moved with respect to the OTHER graph and side-graph.

Any idea?

\begin{figure}[htb]
\begin{minipage}[htb]{0.49\linewidth}
\includegraphics[width=0.84\linewidth]{Graph1}
\includegraphics[width=0.14\linewidth]{Side-graph1}
\subcaption{Blablabla.}
\label{fig:Graph1}
\end{minipage}
\hfill
\begin{minipage}[htb]{0.49\linewidth}
\includegraphics[width=0.84\linewidth]{Graph2}
\includegraphics[width=0.14\linewidth]{Side-Graph2}
\subcaption{Blablabla.}
\label{fig:Graph2}
\end{minipage}
\captionof{figure}{BigBlabla.}
\label{Fig:ABC}
\end{figure}

• It is a bit hard to understand, what you are trying to achieve. Please just upload a screenshot and tell us, what is disturbing you. Also, you should make your code compilable. Thanks. – LaRiFaRi Jun 15 '15 at 7:49
• Package mwe provides a bunch of example images you can use. – Johannes_B Jun 15 '15 at 8:39

There are more possibilities how to vertical centering your sub images. First, which come to my mind is to use tabular environment with column type m{<width>}, which is defined in package array:

Code:

\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{array}

\begin{document}
\begin{figure}[htb]
\setlength{\tabcolsep}{2pt}
\begin{minipage}{0.49\linewidth}
\begin{tabular}{@{}m{0.84\hsize}m{0.14\hsize}@{}}
\includegraphics[width=\hsize,height=3cm]{example-image}    &
\includegraphics[width=\hsize,height=1cm]{example-image}
\end{tabular}
\subcaption{Blablabla.}
\label{fig:Graph1}
\end{minipage}
\hfill
\begin{minipage}{0.49\linewidth}
\begin{tabular}{@{}m{0.84\hsize}m{0.14\hsize}@{}}
\includegraphics[width=\hsize,height=3cm]{example-image}    &
\includegraphics[width=\hsize,height=1cm]{example-image}
\end{tabular}
\subcaption{Blablabla.}
\label{fig:Graph2}
\end{minipage}
\captionof{figure}{BigBlabla.}
\label{Fig:ABC}
\end{figure}
\end{document}


Since the actual size of images are not known, my measures of them are only informative.

See, if this is what you like to obtain:

I guess that you have problem with definition of image width. I replace

\includegraphics[width=0.84\linewidth]{Graph2}


with

\includegraphics[width=0.84\hsize]{example-image}


and for images select test images which provide graphics package. I didn't give any attention to their height. The complete code is:

\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}

\begin{document}
\begin{figure}[htb]
\begin{minipage}[htb]{0.49\linewidth}
\includegraphics[width=0.84\hsize]{example-image}
\includegraphics[width=0.14\hsize]{example-image}
\subcaption{Blablabla.}
\label{fig:Graph1}
\end{minipage}
\hfill
\begin{minipage}[htb]{0.49\linewidth}
\includegraphics[width=0.84\hsize]{example-image}
\includegraphics[width=0.14\hsize]{example-image}
\subcaption{Blablabla.}
\label{fig:Graph2}
\end{minipage}
\captionof{figure}{BigBlabla.}
\label{Fig:ABC}
\end{figure}
\end{document}

• Strange. Packages loaded and syntax changed accordingly, but there only appear a bunch of error messages like "missing number" "illegal units" etc. Is there another way on how to move the side-graphics upwards a little but? Imagine your figure from before with the large and small image. The large one is 3cm high and you want to move the small one higher by about 1cm. That's what I need to achieve. – Lucas Jun 15 '15 at 20:18
• I tested my MWE and it work without of any problem (see picture). I don't know anything about size of your pictures, I just take given width of it. Now, you actually ask a new question, so I will give you (in few minutes) a new answer. – Zarko Jun 15 '15 at 20:27