[Tex/LaTex] How to get a 4×2 subfigure

subfloats

I want to get a 4 row x 2 column subfigure but I can't figure out how to even get 2 images side by side. I've copied and pasted code from the help page and from various help sites but nothing works. The images are stacking below each other, rather than getting 2 columns. Here is an example of my code:

\documentclass[a4paper, 11pt, oneside]{Thesis}
\graphicspath{Figures/}  % Location of the graphics files (set up for graphics 

\usepackage{graphicx}
\usepackage{subfiles}
\usepackage{subfig}

\begin{document}

\begin{figure}[]
    \centering
    \begin{subfigure}[b]{0.4\textwidth}
    \centering
        \includegraphics[width=\linewidth]{Figures/2µm_lines_CA_graph}
        \caption{Contact angle with various pseudo dosages}
        \label{fig:2µm_lines_CA_graph}
    \end{subfigure}
    ~ %add desired spacing between images, e. g. ~, \quad, \qquad, \hfill etc. 
      %(or a blank line to force the subfigure onto a new line)

    \begin{subfigure}[]{0.4\textwidth}
    \centering
        \includegraphics[width=\linewidth]{Figures/2µm_lines_CAH_graph}
        \caption{Contact angle with various pseudo dosages}
        \label{fig:2µm_lines_CAH_graph}
    \end{subfigure}
    \caption{Contact angles on 2 $\mu$m Lines}\label{fig:2µm_lines_CA_graphs}
\end{figure}

\end{document}

Best Answer

  • your question is duplicate to many similar question here, for example as note Bobyandbob in his comment setting-4x2-figures-in-a-page

  • beside this you have some (off-topic) problems:

    • for subfigure environments You need to load subcaption package (I don't know if used document class thesis do this)
    • loading of subfig is superfluous (it is not compatible with subcaption)
    • images with width of subfigure environment has no sense to center in it

consider aforementioned, your MWE become

\documentclass[a4paper, 11pt, oneside]{book}% i haven't thesis document class
%\graphicspath{Figures/}  % Location of the graphics files (set up for graphics

\usepackage[demo]{graphicx}
\usepackage{subcaption}

\begin{document}

\begin{figure}[htp]
    \centering
    \begin{subfigure}[b]{0.4\textwidth}
        \includegraphics[width=\linewidth]{Figures/2µm_lines_CA_graph}
        \caption{Contact angle with various pseudo dosages}
        \label{fig:2µm_lines_CA_graph}
    \end{subfigure}
\hfil
    \begin{subfigure}[b]{0.4\textwidth}
        \includegraphics[width=\linewidth]{Figures/2µm_lines_CAH_graph}
        \caption{Contact angle with various pseudo dosages}
        \label{fig:2µm_lines_CAH_graph}
    \end{subfigure}

    \begin{subfigure}[b]{0.4\textwidth}
        \includegraphics[width=\linewidth]{Figures/2µm_lines_CA_graph}
        \caption{Contact angle with various pseudo dosages}
        \label{fig:2µm_lines_CA_graph}
    \end{subfigure}
\hfil
    \begin{subfigure}[b]{0.4\textwidth}
        \includegraphics[width=\linewidth]{Figures/2µm_lines_CAH_graph}
        \caption{Contact angle with various pseudo dosages}
        \label{fig:2µm_lines_CAH_graph}
    \end{subfigure}

    \begin{subfigure}[b]{0.4\textwidth}
        \includegraphics[width=\linewidth]{Figures/2µm_lines_CA_graph}
        \caption{Contact angle with various pseudo dosages}
        \label{fig:2µm_lines_CA_graph}
    \end{subfigure}
\hfil
    \begin{subfigure}[b]{0.4\textwidth}
        \includegraphics[width=\linewidth]{Figures/2µm_lines_CAH_graph}
        \caption{Contact angle with various pseudo dosages}
        \label{fig:2µm_lines_CAH_graph}
    \end{subfigure}

    \begin{subfigure}[b]{0.4\textwidth}
        \includegraphics[width=\linewidth]{Figures/2µm_lines_CA_graph}
        \caption{Contact angle with various pseudo dosages}
        \label{fig:2µm_lines_CA_graph}
    \end{subfigure}
\hfil
    \begin{subfigure}[b]{0.4\textwidth}
        \includegraphics[width=\linewidth]{Figures/2µm_lines_CAH_graph}
        \caption{Contact angle with various pseudo dosages}
        \label{fig:2µm_lines_CAH_graph}
    \end{subfigure}
    \caption{Contact angles on 2 $\mu$m Lines}\label{fig:2µm_lines_CA_graphs}
\end{figure}

\end{document}