0

I'm trying to center graphs in a 2x3 grid. As can be seen from the image output the code places the graph slightly to the right of the page. Ideally I want the vertical gap between graphs to be in the center of the page. I think there is something obvious wrong with my code but i'm not sure what! Any thoughts?

enter image description here

\begin{figure}[H]
\centering
    \begin{subfigure}[b]{0.3\textwidth}
        \includegraphics[width=2\textwidth]{/Bond/Brazil}
        \caption{Figure 1.1}
    \end{subfigure}
    \qquad
    \qquad
    \qquad
    \qquad
    \qquad
    \quad
    \begin{subfigure}[b]{0.3\textwidth}
        \includegraphics[width=2\textwidth]{/Bond/Brazil}
        \caption{Figure 1.2}
    \end{subfigure}

    \begin{subfigure}[b]{0.3\textwidth}
        \includegraphics[width=2\textwidth]{/Bond/Chile}
        \caption{Figure 1.3}
    \end{subfigure}
    \qquad
    \qquad
    \qquad
    \qquad
    \qquad
    \quad
    \begin{subfigure}[b]{0.3\textwidth}
        \includegraphics[width=2\textwidth]{/Bond/China}
        \caption{Figure 1.4}
    \end{subfigure}

     \begin{subfigure}[b]{0.3\textwidth}
        \includegraphics[width=2\textwidth]{/Bond/Colombia}
        \caption{Figure 1.5}
    \end{subfigure}
    \qquad
    \qquad
    \qquad
    \qquad
    \qquad
    \quad
    \begin{subfigure}[b]{0.3\textwidth}
        \includegraphics[width=2\textwidth]{/Bond/Czech_Republic}
        \caption{Figure 1.6}
    \end{subfigure}
  • 1
    Replace [width=2\textwidth]by [width=\textwidth] and your images will not flow into the right margin any more. However, there will be a quite huge white space in the middle. So you might also want to remove the \qquads and use a more suitable width for your subfigures. – leandriis Mar 3 '18 at 16:02
1
  • similar questions was already asked many, many times ...
  • your code snippet is not complete
  • newer provide only code snippet, but complete small document called minimal working example (mwe), which begin with \documentclass{...} and end with \end{document}, has in preamble loaded only to your problem relevant packages and exhibits your problem.
    • show result of your mwe in question, not in link (after time this link can become dead)

your code is rather strange (see leandriis comment above). after removing all superfluous code and arrange your image as you show on image in link, i obtain:

enter image description here

where red lines show page layout and your images are replaced by example images from graphicx package.

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

%-------------------------------- show page layout, only for test
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}
    \begin{figure}[htb]
\begin{subfigure}[b]{0.45\linewidth}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{Figure 1.1}
    \end{subfigure}%
\hfill%
\begin{subfigure}[b]{0.45\linewidth}
        \includegraphics[width=\linewidth]{example-image-B}
        \caption{Figure 1.2}
    \end{subfigure}

\begin{subfigure}[b]{0.45\linewidth}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{Figure 1.3}
    \end{subfigure}%
\hfill%
\begin{subfigure}[b]{0.45\linewidth}
        \includegraphics[width=\linewidth]{example-image-B}
        \caption{Figure 1.4}
    \end{subfigure}

\begin{subfigure}[b]{0.45\linewidth}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{Figure 1.5}
    \end{subfigure}%
\hfill%
\begin{subfigure}[b]{0.45\linewidth}
        \includegraphics[width=\linewidth]{example-image-B}
        \caption{Figure 1.6}
    \end{subfigure}
\caption{Figure 1 \dots}
\label{fig:fig 1}
    \end{figure}
\end{document}

in your document replace example-image-... with actual ones and remove all stuff of showframe.

  • Thansk so much, appreciate the help. Works perfectly. – Bradley Jordan Mar 3 '18 at 16:56
  • @BradleyJordan, you are welcome! you also can accept answer by clicking on the check mark on the top left side of answer :-) – Zarko Mar 3 '18 at 17:02
  • Done, in future i'll ask questions properly now that I understand how the forum works. Newbie to this, but seems a great community! – Bradley Jordan Mar 4 '18 at 13:34

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.