# Problem on subfigure 2X2

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}
\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}
\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*}


-

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}
\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}


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

-
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 '14 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 '14 at 9:14
Thanks works without mwe package. –  Maryam Aug 15 '14 at 9:17
@Maryam the mwe package was only to get the sample images.. –  greyshade Aug 15 '14 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 '14 at 9:20