我正在尝试将三幅图像和一个表格组合起来,这样我就可以为它们使用一个标题。目标是让它们对齐,形成一个整齐的正方形。
我使用的代码是:
\documentclass{dissertation}
\usepackage{listings}
\usepackage{natbib}
\usepackage[superscript,biblabel]{cite}
\usepackage{graphicx}
\usepackage{url}
\usepackage[english]{babel} % Engelse text
\usepackage[final]{pdfpages}
\usepackage[flushleft]{threeparttable}
\usepackage{booktabs}
\usepackage{booktabs,caption}
\usepackage{epstopdf}
\usepackage{subcaption}
\newcommand{\dtoprule}{\specialrule{1pt}{0pt}{0.4pt}%
\specialrule{0.3pt}{0pt}{\belowrulesep}%}
\newcommand{\dbottomrule}{\specialrule{0.3pt}{0pt}{0.4pt}%
\specialrule{1pt}{0pt}{\belowrulesep}%}
\begin{document}
\begin{figure}[htb]
\centering
\subcaptionbox{}{\includegraphics[width=0.49\linewidth]{"Figures/Linear regression/LinearReg_Fib"}}
\subcaptionbox{}{\includegraphics[width=0.49\linewidth]{"Figures/Linear regression/LinearReg_RBC"}}
\subcaptionbox{}{\includegraphics[width=0.49\linewidth]{"Figures/Linear regression/LinearReg_Leuko"}}
\begin{threeparttable}
\begin{tabular}{cccc}
\dtoprule
& C10 & C01 \\
\midrule
F/P low & 240.1 & 171.3 \\
F/P & 763.5 & 269.08 \\
F/P mo & 1201.0 & 190.6 \\
F/P h & 6651.6 & -345.9 \\
\dbottomrule
\end{tabular}
\end{threeparttable}
\caption{\textbf{Linear regression model between sample stiffness (determined as the tangent modulus at 75\%) and (a) Fibrin/platelet content, (b) Red blood cells and (c) Leukocytes}}
\label{fig:LinearRegression}
\end{figure}
\end{document}
在附带的图片中,您可以看到结果。基本上,我想要的是让桌子稍微向上移动一点,这样它就能很好地适应右下角的空隙。希望有人能帮忙!
答案1
像这样?
\documentclass{book}
\usepackage[demo]{graphicx} % in real document remove option "demo"
\usepackage{booktabs}
\usepackage[textfont=bf]{caption} % <--- new
\usepackage{subcaption}
\usepackage{siunitx} % <--- new
\begin{document}
\begin{figure}[htb]
\centering
\begin{subfigure}{0.48\linewidth}
\includegraphics[width=\linewidth]{Figures/Linear regression/LinearReg_Fib}
\caption{}
\end{subfigure}
\hfill
\begin{subfigure}{0.48\linewidth}
\includegraphics[width=\linewidth]{Figures/Linear regression/LinearReg_RBC"}
\caption{}
\end{subfigure}
\medskip
\begin{subfigure}{0.48\linewidth}
\includegraphics[width=\linewidth]{Figures/Linear regression/LinearReg_Leuko"}
\caption{}
\end{subfigure}
\hfill
\begin{subfigure}{0.459\linewidth}
\centering
\sisetup{group-four-digits}
\begin{tabular}{l S[table-format=4.1]S[table-format=-3.2] }
\toprule
& C10 & C01 \\
\midrule
F/P low & 240.1 & 171.3 \\
F/P & 763.5 & 269.08 \\
F/P mo & 1201.0 & 190.6 \\
F/P h & 6651.6 & -345.9 \\
\bottomrule
\end{tabular}
\end{subfigure}
\caption{Linear regression model between sample stiffness (determined as the tangent modulus at 75\%) and (a) Fibrin/platelet content, (b) Red blood cells and (c) Leukocytes}
\label{fig:LinearRegression}
\end{figure}
\end{document}
编辑:
在表格中,我建议使用包S
中定义的列 siunitx
。使用时,表格中的数字按小数点对齐。