You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在LaTeX中强制将两组图形放置在同一页面?

解决方案

要实现四张图同页展示且保留每组的标题和标签,你可以借助subcaption包(推荐使用,兼容性更好),将两组并排图放在同一个figure环境内,用subfigure包裹每组内容,为每组单独设置标题和标签。

修改后的代码示例

% 先在导言区引入所需包
\usepackage{subcaption}

\begin{figure}[hp]
    % 第一组:资本<1000的 cohort
    \begin{subfigure}{\textwidth}
        \makebox[\textwidth]{
            \includegraphics[width=0.5\textwidth]{ACEM_graph3_size1.png}
            \includegraphics[width=0.5\textwidth]{ACEM_graph4_size1.png}
        }
        \caption{Cohort with capital $< 1000$}
        \label{ACEM1}
    \end{subfigure}
    
    \vspace{1em} % 两组间添加垂直间距,避免排版拥挤
    
    % 第二组:资本>1000的 cohort
    \begin{subfigure}{\textwidth}
        \makebox[\textwidth]{
            \includegraphics[width=0.5\textwidth]{ACEM_graph3_size2.png}
            \includegraphics[width=0.5\textwidth]{ACEM_graph4_size2.png}
        }
        \caption{Cohort with capital $> 1000$}
        \label{ACEM2}
    \end{subfigure}
    
    % 可选:若需要整个大figure的总标题,取消以下注释
    % \caption{不同资本规模的 cohort 对比图}
    % \label{ACEM_all}
\end{figure}

关键说明

  • subcaption包提供的subfigure环境,允许在单个大figure内嵌套多个带独立标题、标签的子区域,完美匹配你的需求。
  • 修正了原代码里的拼写错误:captial改为capital。
  • 两组图之间的\vspace{1em}可根据实际排版需求调整间距大小。
  • 每组的标签(\label{ACEM1}、\label{ACEM2})仍可正常通过\ref{}命令引用。

内容的提问来源于stack exchange,提问作者acubens555

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.08 16:05:59