0

I have this code where I place 4 plots in two figure* blocks:

\subsection{Encoders Evaluation}
\begin{figure*}
    \centering
    \begin{subfigure}[b]{0.49\textwidth}
        \includegraphics[width=\textwidth]{Figures/mapVLADvsFV.png}
        \caption{}
        \label{fig:mapVLADvsFV}
    \end{subfigure}
    \begin{subfigure}[b]{0.49\textwidth}
        \includegraphics[width=\textwidth]{Figures/timesVLADvsFV.png}
        \caption{}
        \label{fig:timesVLADvsFV}
    \end{subfigure}
    \caption{VLAD and FV comparison. Figure \ref{fig:mapVLADvsFV} shows precision of the two encoding techniques, while Figure \ref{fig:descTimes} shows their efficiency.}\label{fig:PHA}
\end{figure*}
\begin{figure*}
    \centering
    \begin{subfigure}[b]{0.49\textwidth}
        \includegraphics[width=\textwidth]{Figures/VLADCenters.png}
        \caption{}
        \label{fig:VLADCenters}
    \end{subfigure}
    \begin{subfigure}[b]{0.49\textwidth}
        \includegraphics[width=\textwidth]{Figures/VLADTimes.png}
        \caption{}
        \label{fig:VLADTimes}
    \end{subfigure}
    \caption{VLAD results depending on the number of centers and descriptors used. Figure \ref{fig:VLADCenters} shows the precision of SURF and PHA, while Figure \ref{fig:descTimes} shows the efficiency of each descriptor..}\label{fig:PHA}
\end{figure*}

However, the figures are placed 2 pages later with several other figures... Why this happens?

This is a picture of these plots in the resulting document:

enter image description here

  • 2
    If you want thhe pictures to stay together, use a single figure* environment. Just replace \end{figure*}\begin{figure*} with a blank line. – egreg Sep 6 '17 at 10:45
  • 1
    And yes, you can have more than one caption per figure. – John Kormylo Sep 6 '17 at 11:19
  • tex.stackexchange.com/a/125294/140011 - see here for a working example solution – nhck Sep 6 '17 at 12:12
2

just add option [t] to figure* environment:

\documentclass[twocolumn]{article}
\usepackage[demo]{graphicx}
\usepackage{caption}
\usepackage{subcaption}

\usepackage{showframe}
\usepackage{lipsum}
\begin{document}
\subsection{Encoders Evaluation}
\begin{figure*}[t]
\centering
\begin{subfigure}[b]{0.49\textwidth}
    \includegraphics[width=\textwidth]{Figures/mapVLADvsFV.png}
    \caption{}
    \label{fig:mapVLADvsFV}
\end{subfigure}\hfil
\begin{subfigure}[b]{0.49\linewidth}
    \includegraphics[width=\linewidth]{Figures/timesVLADvsFV.png}
    \caption{}
    \label{fig:timesVLADvsFV}
\end{subfigure}
\caption{VLAD and FV comparison. Figure \ref{fig:mapVLADvsFV} shows precision of the two encoding techniques, while Figure \ref{fig:descTimes} shows their efficiency.}
\label{fig:PHA}
\end{figure*}      % you can omit this and next line
\begin{figure*}[t] % you can omit this line
\begin{subfigure}[b]{0.49\linewidth}
    \includegraphics[width=\linewidth]{Figures/VLADCenters.png}
    \caption{}
    \label{fig:VLADCenters}
\end{subfigure}\hfil
\begin{subfigure}[b]{0.49\linewidth}
    \includegraphics[width=\linewidth]{Figures/VLADTimes.png}
    \caption{}
    \label{fig:VLADTimes}
\end{subfigure}
\caption{VLAD results depending on the number of centers and descriptors used. Figure \ref{fig:VLADCenters} shows the precision of SURF and PHA, while Figure \ref{fig:descTimes} shows the efficiency of each descriptor..}
\label{fig:PHA}
\end{figure*}
\lipsum\lipsum
\end{document}

enter image description here

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.