如何在同一页上放置两列图表

如何在同一页上放置两列图表

我需要有人帮我完成这项任务。我使用下面的代码清单来实现图 1 所示的图表。

\documentclass[12pt,a4paper,notitlepage]{article}
%\documentclass[12pt,a4paper,notitlepage]{report}
\usepackage[numbers, authoryear]{natbib}
\usepackage[english]{babel}
\usepackage{amsmath,amssymb,amsthm,mathtools}
\usepackage{graphicx}
\usepackage{color}
\usepackage{subfig}
\usepackage[a4paper,bindingoffset=0.0in,left=0.7in,right=0.7in,top=0.7in,bottom=0.7in,footskip=0.5in]{geometry}
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{figure}[!ht]
    {\begin{minipage}{\dimexpr\linewidth-2.50cm+2.5cm}
        \centering
        \rotatebox{90}{\makebox[0pt]{{CM Double Differential Cross--section (mb/MeV/sr)}}}
        {\begin{minipage}{10.82cm+1cm}%
            \raisebox{\dimexpr-.5\height-1em}{\includegraphics[width=10.82cm]{Figures/sum36ho1.eps}}\ \\
            \raisebox{\dimexpr-.5\height-1em}{\includegraphics[width=10.82cm]{Figures/sum36ho2.eps}}\ \\
            \raisebox{\dimexpr-.5\height-1em}{\includegraphics[width=10.82cm]{Figures/sum36ho3.eps}}\ 

            %% use hspace to center the x-axis lable and then add some space at the end for the subfloat labels.
            \vspace*{0.1cm}\hspace*{\fill}{Alpha Particle Energy (MeV)}\hspace*{\fill}%\hspace*{0.5cm}
        \end{minipage}}%
        %\caption{As in Figure~\ref{fig:sum36sn} but for $^{165}$Ho.}
        \caption{}
    \end{minipage}}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}

我可以对代码进行哪些修改,以便包含另外三个图表,使图形看起来像图 2。提前致谢。

图1 图2

答案1

这是产生所请求输出的简化代码。

示例输出

\documentclass[12pt,a4paper]{article}
\usepackage[english]{babel}
\usepackage{amssymb,amsthm,mathtools}
\usepackage{graphicx}
\usepackage[a4paper,bindingoffset=0in,margin=0.7in,footskip=0.5in]{geometry}
\begin{document}

\begin{figure}[htp]
    \begin{minipage}{0.95\linewidth}
        \centering
        \rotatebox{90}{\makebox[0pt]{{CM Double Differential
        Cross--section (mb/MeV/sr)}}}
        \newlength{\figwidth}
        \setlength{\figwidth}{0.4\linewidth}
        \begin{minipage}{\figwidth+1cm}%
          \centering
          \includegraphics[width=\figwidth]{example-image-a}\\
          \includegraphics[width=\figwidth]{example-image-a}\\
          \includegraphics[width=\figwidth]{example-image-a}\\          
          Alpha Particle Energy (MeV)
        \end{minipage}
        \begin{minipage}{\figwidth+1cm}%
          \centering
          \includegraphics[width=\figwidth]{example-image-b}\\
          \includegraphics[width=\figwidth]{example-image-b}\\
          \includegraphics[width=\figwidth]{example-image-b}\\          
          Beta Particle Energy (MeV)
        \end{minipage}
        \caption{A caption}
    \end{minipage}
\end{figure}

\end{document}

笔记:

  • 我没有您的图像,因此我使用了发行版中的标准图像。

  • 我引入了一个新的长度\figwidth来保持图形所需的宽度

  • 所有\raisebox命令均已删除

  • \centering用于每列的水平对齐

  • 我假设所有图形的长宽比都是相同的

  • 维度表达式已简化,并删除了不必要的组嵌套

  • mathtools加载amsmath,因此后者不需要加载

  • margingeometry一次性设置所有四个边距

相关内容