Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I try to put figures in 2X2, but they appear in 4 rows.

\begin{figure*}
\begin{minipage}{\textwidth}
\centering
\begin{subfigure}[b]{1\textwidth}
\centering
    \includegraphics[scale=0.3]{images/mean/N14.png}
    \caption[Network2]%
    {{\small Network 1}}    
\label{fig:mean and std of net14}
\end{subfigure}
\quad
 \begin{subfigure}[b]{1\textwidth}  
 \centering 
        \includegraphics[scale=0.29]{images/mean/N24.png}
        \caption[]%
        {{\small Network 2}}    
        \label{fig:mean and std of net24}
        \end{subfigure}

    \begin{subfigure}[b]{1\textwidth}   
 \centering 
        \includegraphics[scale=0.29]{images/mean/N34.png}
        \caption[]%
        {{\small Network 3}}    
        \label{fig:mean and std of net34}
        \end{subfigure}
        \quad
        \begin{subfigure}[b]{1\textwidth}   
 \centering 
        \includegraphics[scale=0.29]{images/mean/N44.png}
        \caption[]%
        {{\small Network 4}}    
        \label{fig:mean and std of net44}
        \end{subfigure}


        \caption[ The average and standard deviation of critical parameters ]
        {\small The average and standard deviation of critical parameters: Region R4} 
        \label{fig:mean and std of nets}
        \end{minipage}
\end{figure*}

Any suggestion please?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Each of your \subfigures is 1\textwidth wide - there's no way LaTeX could fit two of these in a row. Also you don't need the minipage there.

Try something like this:

\documentclass{article}

\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{mwe}

\begin{document}
    \begin{figure*}
        \centering
        \begin{subfigure}[b]{0.475\textwidth}
            \centering
            \includegraphics[width=\textwidth]{Example-Image}
            \caption[Network2]%
            {{\small Network 1}}    
            \label{fig:mean and std of net14}
        \end{subfigure}
        \hfill
        \begin{subfigure}[b]{0.475\textwidth}  
            \centering 
            \includegraphics[width=\textwidth]{Example-Image}
            \caption[]%
            {{\small Network 2}}    
            \label{fig:mean and std of net24}
        \end{subfigure}
        \vskip\baselineskip
        \begin{subfigure}[b]{0.475\textwidth}   
            \centering 
            \includegraphics[width=\textwidth]{Example-Image}
            \caption[]%
            {{\small Network 3}}    
            \label{fig:mean and std of net34}
        \end{subfigure}
        \quad
        \begin{subfigure}[b]{0.475\textwidth}   
            \centering 
            \includegraphics[width=\textwidth]{Example-Image}
            \caption[]%
            {{\small Network 4}}    
            \label{fig:mean and std of net44}
        \end{subfigure}
        \caption[ The average and standard deviation of critical parameters ]
        {\small The average and standard deviation of critical parameters: Region R4} 
        \label{fig:mean and std of nets}
    \end{figure*}
\end{document}

2x2 output

Of course you would drop the \usepackage{mwe} and substitute your pictures back in at appropriate scaling.

share|improve this answer
    
Thanks, but when I am using these two packages mwe, and subcaption, I get this error: ! LaTeX Error: Can be used only in preamble.Any idea please? –  Maryam Aug 15 at 9:11
    
@Maryam did you try running the exact code from my example? That compiles fine for me on a clean TeXLive 2014. Otherwise do make sure all \usepackage are before \begin{document}. –  greyshade Aug 15 at 9:14
    
Thanks works without mwe package. –  Maryam Aug 15 at 9:17
    
@Maryam the mwe package was only to get the sample images.. –  greyshade Aug 15 at 9:18
    
You don't actually need to add \usepackage{mwe} explicitly to use those images, as long as the package is installed they're available. –  Torbjørn T. Aug 15 at 9:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.