是否可以将图形和表格放在一张图中?
\usepackage{subcaption}
\begin{figure}[b]
\centering
\includegraphics[width=0.4\linewidth]{Fit3Dir_30min/ModelSelectionGraphs/Histogram_smad7_reproduced_AICc}
\begin{tabular}{c|c|c|c}
Model Selection Criteria & Model 1 & Model 2 & Model 3\\
\hline
RSS & 614.037 & 615.003 & 698.592\\
AICc & 234.751 & 234.996 & 254.877\\
BIC & 264.25 & 264.495 & 284.376\\
\end{tabular}
\caption{Distribution of corrected Akaike information criteria (AICc) per model}
\label{fig:model_selection}
\end{figure}
这只是完成了一半。我希望能够为表格和图表添加单独的标题和标签,因为它们是独立的东西,但仍属于一个图。
我尝试将表格和图形部分包装在subfigure
但没有成功,我还看到了其他一些帖子,例如这这也没有解决我的问题。
我正在寻找最简单的解决方案,最好使用子标题包,因为这是我对其余图形所使用的。
提前致谢
答案1
如果您想将表格放在图片下方,您可以使用包subfig
(如您发布的链接中所示),像这样
\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{subfig}
\begin{document}
\begin{figure}[!htbp]
\centering
\subfloat[][]{%
\includegraphics[width=.4\linewidth]{example-image}
}%
\vfill
\subfloat[][]{%
\begin{tabular}{c|c|c|c}
Model Selection Criteria & Model 1 & Model 2 & Model 3\\
\hline
RSS & 614.037 & 615.003 & 698.592\\
AICc & 234.751 & 234.996 & 254.877\\
BIC & 264.25 & 264.495 & 284.376\\
\hline
\end{tabular}
}
\caption{Distribution of corrected Akaike information criteria (AICc) per model}
\label{fig:model_selection}
\end{figure}
\end{document}
答案2
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{array}
\usepackage{caption}
\begin{document}
\begin{figure}[b]
\centering
\begin{minipage}[t]{0.4\linewidth}\vspace{0pt}
\includegraphics[width=\linewidth]{Fit3Dir_30min/ModelSelectionGraphs/Histogram_smad7_reproduced_AICc}
\caption{Distribution of corrected Akaike information criteria (AICc) per model}
\label{fig:model_selection}
\end{minipage}
\hfill
\begin{minipage}[t]{0.57\linewidth}
\captionof{table}{A tabular caption}
\resizebox{\linewidth}{!}{%
\begin{tabular}{c|c|c|c}
Model Selection Criteria & Model 1 & Model 2 & Model 3\\\hline
RSS & 614.037 & 615.003 & 698.592\\
AICc & 234.751 & 234.996 & 254.877\\
BIC & 264.25 & 264.495 & 284.376\\
\end{tabular}}
\end{minipage}
\end{figure}
\end{document}