子图 2X2 的问题

子图 2X2 的问题

我尝试将图形放入 2X2 中,但它们出现在 4 行中。

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

请问有什么建议吗?

答案1

每个\subfigures 都很1\textwidth宽 - LaTeX 不可能将两个这样的 s 放在一行中。另外,您不需要那里的 minipage。

尝试这样的操作:

\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}
        \hfill
        \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 输出

当然,您可以删除它\usepackage{mwe},然后以适当的比例替换您的图片。

答案2

这对我也有用:

\begin{figure}
\begin{adjustwidth}{-8em}{0em}
  \begin{subfigure}[b]{0.7\textwidth}
    \includegraphics[width=\textwidth]{images/.png}
    \caption{}
    \label{fig:}
  \end{subfigure}
  %
  \begin{subfigure}[b]{0.7\textwidth}
    \includegraphics[width=\textwidth]{images/.png}
    \caption{}
    \label{fig:}
  \end{subfigure}
\end{adjustwidth}
\begin{adjustwidth}{-8em}{0em}
  \begin{subfigure}[b]{0.7\textwidth}
    \includegraphics[width=\textwidth]{images/.png}
    \caption{}
    \label{fig:}
  \end{subfigure}
  %
  \begin{subfigure}[b]{0.7\textwidth}
    \includegraphics[width=\textwidth]{images/.png}
    \caption{}
    \label{fig:}
  \end{subfigure}
\end{adjustwidth}
\end{figure}

答案3

您的解决方案非常有帮助。

请注意,它只适用于\usepackage{changepage}

我认为你应该将其包含在你的答案中。

再次感谢,Nadav A

相关内容