如何增加/减少两个子图之间的间距?以及如何使子标题居中?

如何增加/减少两个子图之间的间距?以及如何使子标题居中?

我在课堂上有以下 LaTeX 代码memoir。我在处理两个顶部图之间的间距时遇到了问题。此外,子图标题 (a)、(b) 和 (c) 未居中。我是 LaTeX 的初学者,但我正在撰写博士论文。因此,任何快速帮助都将不胜感激。

\documentclass{memoir}
\usepackage{pgfplots}
\usepackage{subcaption}
\pgfplotsset{compat=1.3} 
\usepackage[margin=1in]{geometry}
\captionsetup{compatibility=false}
\begin{document} 

\begin{figure}\small
\begin{minipage}[b]{.5\linewidth}
\centering
\begin{tikzpicture}
\begin{axis}[xmin=-1, xmax=14, ymin=-100, ymax=1200, width =8 cm, xtick align =inside, ytick align =inside, xtick distance =3, ytick distance =200, xlabel = Nanosilica content (wt\%), ylabel= {Fracture energy, $G_{IC}$ ${(J/m^2)}$},legend style= {font=\tiny, legend pos= north west, legend cell align={left}}]
\addplot[cyan, thick] coordinates
{(0,220) (3,276) (6,302) (9,322) (12,338)};\addlegendentry{model (3 wt\% CSR-epoxy matrix)};
\addplot[only marks = o*,
    cyan, error bars/.cd,
                y dir=both,
                y explicit] table [x=a, y=b, y error = c]{F_7.3a.txt};\addlegendentry{Experimental};
\end{axis}
\end{tikzpicture}
\subcaption{}\label{fig:3a}
\end{minipage}%
%
\begin{minipage}[b]{.5\linewidth}
\centering
\begin{tikzpicture}
 \begin{axis}[xmin=-1, xmax=14, ymin=-100, ymax=1200, width = 8cm, xtick align =inside, ytick align =inside, xtick distance =3, ytick distance =200, xlabel = Nanosilica content (wt\%), ylabel= {Fracture energy, $G_{IC}$ ${(J/m^2)}$},legend style= {font=\tiny, legend pos= north west, legend cell align={left}}]
\addplot[cyan, thick] coordinates
{(0,430) (3,548) (6,604) (9,646) (12,681)};\addlegendentry{model (6 wt\% CSR-epoxy matrix)};
\addplot[only marks = o*,
    cyan, error bars/.cd,
                y dir=both,
                y explicit] table [x=a, y=b, y error = c]{F_7.3b.txt};\addlegendentry{Experimental};
\end{axis}
\end{tikzpicture}
\subcaption{}\label{fig:10b}
\end{minipage} \par\medskip
\centering
\begin{minipage}[b]{.5\linewidth}

\begin{tikzpicture}
 \begin{axis}[xmin=-1, xmax=14, ymin=-100, ymax=1200, width = 8cm, xtick align =inside, ytick align =inside, xtick distance =3, ytick distance =200, xlabel = Nanosilica content (wt\%), ylabel= {Fracture energy, $G_{IC}$ ${(J/m^2)}$},legend style= {font=\tiny, legend pos= north west, legend cell align={left}}]
\addplot[cyan, thick] coordinates
{(0,430) (3,548) (6,604) (9,646) (12,681)};\addlegendentry{model (6 wt\% CSR-epoxy matrix)};
\addplot[only marks = o*,
    cyan, error bars/.cd,
                y dir=both,
                y explicit] table [x=a, y=b, y error = c]{F_7.3b.txt};\addlegendentry{Experimental};
\end{axis}
\end{tikzpicture}
\subcaption{}\label{fig:10b}
\end{minipage}
\caption{Hybrid modified epoxy}\label{fig:10}
\end{figure}
\end{document}

答案1

请参阅以下 MWE(重要的代码更改以 标记<=========):

\documentclass{memoir}

\usepackage{pgfplots}
\usepackage{subcaption}
\pgfplotsset{compat=1.3} 
\usepackage[%
  margin=1in,
  showframe % <=========================================================
]{geometry}
\usepackage{blindtext} % <==============================================
\captionsetup{compatibility=false}


\begin{document} 

\blindtext
\begin{figure}\small
\begin{minipage}[b]{.45\linewidth} % <==================================
\centering
\begin{tikzpicture}
\begin{axis}[xmin=-1, xmax=14, ymin=-100, ymax=1200, width =8 cm, xtick align =inside, ytick align =inside, xtick distance =3, ytick distance =200, xlabel = Nanosilica content (wt\%), ylabel= {Fracture energy, $G_{IC}$ ${(J/m^2)}$},legend style= {font=\tiny, legend pos= north west, legend cell align={left}}]
\addplot[cyan, thick] coordinates
{(0,220) (3,276) (6,302) (9,322) (12,338)};\addlegendentry{model (3 wt\% CSR-epoxy matrix)};
\addplot[only marks = o*,
    cyan, error bars/.cd,
                y dir=both,
                y explicit] table [x=a, y=b, y error = c]{F_7.3a.txt};\addlegendentry{Experimental};
\end{axis}
\end{tikzpicture}
\subcaption{test a}\label{fig:3a}
\end{minipage}%
\hfil % <===============================================================
\begin{minipage}[b]{.45\linewidth} % <==================================
\centering
\begin{tikzpicture}
 \begin{axis}[xmin=-1, xmax=14, ymin=-100, ymax=1200, width = 8cm, xtick align =inside, ytick align =inside, xtick distance =3, ytick distance =200, xlabel = Nanosilica content (wt\%), ylabel= {Fracture energy, $G_{IC}$ ${(J/m^2)}$},legend style= {font=\tiny, legend pos= north west, legend cell align={left}}]
\addplot[cyan, thick] coordinates
{(0,430) (3,548) (6,604) (9,646) (12,681)};\addlegendentry{model (6 wt\% CSR-epoxy matrix)};
\addplot[only marks = o*,
    cyan, error bars/.cd,
                y dir=both,
                y explicit] table [x=a, y=b, y error = c]{F_7.3b.txt};\addlegendentry{Experimental};
\end{axis}
\end{tikzpicture}
\subcaption{test test test test test test test test test test test test test test b}\label{fig:10b}
\end{minipage} 
\par\bigskip % \medskip <===============================================
\centering
\begin{minipage}[b]{.45\linewidth} % <==================================
\begin{tikzpicture}
 \begin{axis}[xmin=-1, xmax=14, ymin=-100, ymax=1200, width = 8cm, xtick align =inside, ytick align =inside, xtick distance =3, ytick distance =200, xlabel = Nanosilica content (wt\%), ylabel= {Fracture energy, $G_{IC}$ ${(J/m^2)}$},legend style= {font=\tiny, legend pos= north west, legend cell align={left}}]
\addplot[cyan, thick] coordinates
{(0,430) (3,548) (6,604) (9,646) (12,681)};\addlegendentry{model (6 wt\% CSR-epoxy matrix)};
\addplot[only marks = o*,
    cyan, error bars/.cd,
                y dir=both,
                y explicit] table [x=a, y=b, y error = c]{F_7.3b.txt};\addlegendentry{Experimental};
\end{axis}
\end{tikzpicture}
\subcaption{test test test test test test test test test test test test c}\label{fig:10b}
\end{minipage}
\caption{Hybrid modified epoxy}\label{fig:10}
\end{figure}
\blindtext
\end{document}

为了在子火 a 和 b 之间获得更大的空间,您需要减少两个小页面的宽度,例如:

\begin{minipage}[b]{.45\linewidth}

根据您的需要进行更改.45(三次!a)、b)和c))。在两个小页面之间使用a\hfil来获得一个小的空间(1-0.45-0.45 = 0.1 \ linewidth)...

为了在 a/b 和子图 c 之间获得更大的空间,请更改\medskip tobigskip` 如下:

\par\bigskip % \medskip

子图全部居中。为了显示我为子图 b 和 c 添加了子标题。将子图 a 的较小子标题与它们进行比较。

MWE 的结果页面是:

enter image description here

相关内容