如何在 2x2 的矩形内放置四幅图像且彼此之间没有空格?

如何在 2x2 的矩形内放置四幅图像且彼此之间没有空格?

问题:图像之间不应该有空格。但是却有。

代码 (合理使用):

\documentclass{article}

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

\begin{document}
\begin{figure*}
    \centering
    \begin{subfigure}[b]{.5\columnwidth}
        \centering
        \caption{{\small Network 1}}
        \includegraphics[width=\columnwidth]{frog.jpg}
        \label{fig:mean and std of net14}
    \end{subfigure}
    \begin{subfigure}[b]{.5\columnwidth}  
        \centering
        \caption{{\small Network 1}}
        \includegraphics[width=\columnwidth]{frog.jpg}
        \label{fig:mean and std of net24}
    \end{subfigure}
    \begin{subfigure}[b]{.5\columnwidth}   
        \centering 
        \includegraphics[width=\columnwidth]{frog.jpg}
        \caption{{\small Network 1}}
        \label{fig:mean and std of net34}
    \end{subfigure}
    \begin{subfigure}[b]{.5\columnwidth}   
        \centering 
        \includegraphics[width=\columnwidth]{frog.jpg}
        \caption{{\small Network 1}}
        \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}

它看起来如下(使用 Overleaf): 使用 Overleaf:结果

它看起来应该是什么样的(当然没有框架): 它应该是什么样子

答案1

我明白了

在此处输入图片描述

在列( )和行( )tabular之间的空间被抑制的地方插入子图,并用符号消除一些虚假空间。@{}\renewcommand{\arraystretch}{0}%

\documentclass[twocolumn]{article}

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

\begin{document}
\begin{figure*}
    \centering
    {\renewcommand{\arraystretch}{0}
    \begin{tabular}{c@{}c}
    \begin{subfigure}[b]{.5\columnwidth}
        \centering
        \caption{{\small Network 1}}
        \includegraphics[width=\columnwidth]{frog.jpg}%
        \label{fig:mean and std of net14}
    \end{subfigure}&
    \begin{subfigure}[b]{.5\columnwidth}  
        \centering
        \caption{{\small Network 1}}
        \includegraphics[width=\columnwidth]{frog.jpg}%
        \label{fig:mean and std of net24}
    \end{subfigure}\\
    \begin{subfigure}[t]{.5\columnwidth}   
        \centering 
        \includegraphics[width=\textwidth]{frog.jpg}%
        \caption{{\small Network 1}}
        \label{fig:mean and std of net34}
    \end{subfigure}&
    \begin{subfigure}[t]{.5\columnwidth}   
        \centering 
        \includegraphics[width=\columnwidth]{frog.jpg}%
        \caption{{\small Network 1}}
        \label{fig:mean and std of net44}
    \end{subfigure}
    \end{tabular}}
    \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}

相关内容