
我下面有一張表格,我想在其右側插入一個數字。表格和圖形都將使用單一標題。下面是我的表程式碼。
\begin{table*}
\begin{center}
\begin{tabular}{|l|l|cc|cc|cc|}
\hline%\noalign{\smallskip}
\multirow{2}{*}{Type} & \multirow{2}{*}{Model} & \multicolumn{2}{c|}{$\text{x}_{1:10} \rightarrow \hat{\text{x}}_{11:30}$} & \multicolumn{2}{c|}{$\text{x}_{1:10} \rightarrow \hat{\text{x}}_{11:50}$} & \multicolumn{2}{c|}{$\text{x}_{1:10} \rightarrow \hat{\text{x}}_{11:70}$} \\
& & SSIM & PSNR & SSIM & PSNR & SSIM & PSNR \\
\hline
\multirow{3}{*}{Deterministic} \ & 2D ConvLSTM \cite{convlstm} & 0.712 & 23.58 & 0.639 & 22.85 & 0.551 & 20.13 \\
& PredRNN++ \cite{wang-predrnn} & 0.865 & 28.47 & 0.741 & 25.21 & 0.702 & 23.51 \\
& E3D-LSTM \cite{wang-e3d} & \textbf{0.879} & \textbf{29.31} & 0.810 & 27.24 & 0.798 & 26.82 \\
\hline
\multirow{2}{*}{Stochastic} & Variational 2D ConvLSTM \cite{vrnn} & 0.787 & 25.76 & 0.733 & 24.83 & 0.672 & 23.13 \\
& Variational 3D ConvLSTM (Ours) & 0.866 & 28.31 & \textbf{0.852} & \textbf{27.89} & \textbf{0.846} & \textbf{27.66} \\
\hline
\end{tabular}
\end{center}
\caption{Results on the KTH action dataset when using 10 frames to predict 20 ($\text{x}_{1:10} \rightarrow \hat{\text{x}}_{11:30}$), 40 ($\text{x}_{1:10} \rightarrow \hat{\text{x}}_{11:50}$), and 60 ($\text{x}_{1:10} \rightarrow \hat{\text{x}}_{11:70}$) timesteps into the future. The metrics are computed frame-wise. Higher SSIM and PSNR scores indicate better results.}
\label{table:quantitativekth}
\end{table*}
我嘗試按照這裡的代碼包含表格作為子圖但該圖總是出現在下面。
\begin{table*}
\begin{center}
\subfloat[][]{\begin{tabular}{|l|l|cc|cc|cc|}
\hline%\noalign{\smallskip}
\multirow{2}{*}{Type} & \multirow{2}{*}{Model} & \multicolumn{2}{c|}{$\text{x}_{1:10} \rightarrow \hat{\text{x}}_{11:30}$} & \multicolumn{2}{c|}{$\text{x}_{1:10} \rightarrow \hat{\text{x}}_{11:50}$} & \multicolumn{2}{c|}{$\text{x}_{1:10} \rightarrow \hat{\text{x}}_{11:70}$} \\
& & SSIM & PSNR & SSIM & PSNR & SSIM & PSNR \\
\hline
\multirow{3}{*}{Deterministic} \ & 2D ConvLSTM \cite{convlstm} & 0.712 & 23.58 & 0.639 & 22.85 & 0.551 & 20.13 \\
& PredRNN++ \cite{wang-predrnn} & 0.865 & 28.47 & 0.741 & 25.21 & 0.702 & 23.51 \\
& E3D-LSTM \cite{wang-e3d} & \textbf{0.879} & \textbf{29.31} & 0.810 & 27.24 & 0.798 & 26.82 \\
\hline
\multirow{2}{*}{Stochastic} & Variational 2D ConvLSTM \cite{vrnn} & 0.787 & 25.76 & 0.733 & 24.83 & 0.672 & 23.13 \\
& Variational 3D ConvLSTM (Ours) & 0.866 & 28.31 & \textbf{0.852} & \textbf{27.89} & \textbf{0.846} & \textbf{27.66} \\
\hline
\end{tabular}
}
\quad
\subfloat[][]{\includegraphics[width=0.1\textwidth]{kth.png}}
\end{center}
\caption{Results on the KTH action dataset when using 10 frames to predict 20 ($\text{x}_{1:10} \rightarrow \hat{\text{x}}_{11:30}$), 40 ($\text{x}_{1:10} \rightarrow \hat{\text{x}}_{11:50}$), and 60 ($\text{x}_{1:10} \rightarrow \hat{\text{x}}_{11:70}$) timesteps into the future. The metrics are computed frame-wise. Higher SSIM and PSNR scores indicate better results.}
\label{table:quantitativekth}
\end{table*}
答案1
- 您的表格有點寬,因此在下面的 MWE 中,我減少了表格中使用的字體大小和大小
\tabcolsep
- table 和 image 封裝在 table 中
- 對於圖形的垂直居中,使用包
valign=c
中定義的 c 選項adjustbox
(它還加載graphicx
包,
\documentclass[twocolumn]{article}
%\usepackage{geometry}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\usepackage[export]{adjustbox}
\usepackage{multirow}
\usepackage{siunitx}
\begin{document}
\begin{table*}
\centering
\setlength\tabcolsep{4pt}
\begin{tabular}{@{} lr @{}}
\small
\begin{tabular}{@{} |l|l|cc|cc|cc|@{}}
\hline
\multirow{2}{*}{Type} & \multirow{2}{*}{Model} & \multicolumn{2}{c|}{$\text{x}_{1:10} \rightarrow \hat{\text{x}}_{11:30}$} & \multicolumn{2}{c|}{$\text{x}_{1:10} \rightarrow \hat{\text{x}}_{11:50}$} & \multicolumn{2}{c|}{$\text{x}_{1:10} \rightarrow \hat{\text{x}}_{11:70}$} \\
& & SSIM & PSNR & SSIM & PSNR & SSIM & PSNR \\
\hline
\multirow{3}{*}{Deterministic} \ & 2D ConvLSTM \cite{convlstm} & 0.712 & 23.58 & 0.639 & 22.85 & 0.551 & 20.13 \\
& PredRNN++ \cite{wang-predrnn} & 0.865 & 28.47 & 0.741 & 25.21 & 0.702 & 23.51 \\
& E3D-LSTM \cite{wang-e3d} & \textbf{0.879} & \textbf{29.31} & 0.810 & 27.24 & 0.798 & 26.82 \\
\hline
\multirow{2}{*}{Stochastic} & Variational 2D ConvLSTM \cite{vrnn} & 0.787 & 25.76 & 0.733 & 24.83 & 0.672 & 23.13 \\
& Variational 3D ConvLSTM (Ours) & 0.866 & 28.31 & \textbf{0.852} & \textbf{27.89} & \textbf{0.846} & \textbf{27.66} \\
\hline
\end{tabular}
&
\includegraphics[width=0.1\linewidth,valign=c]{example-image-duck}
\end{tabular}
\caption{Results on the KTH action dataset when using 10 frames to predict 20 ($\text{x}_{1:10} \rightarrow \hat{\text{x}}_{11:30}$), 40 ($\text{x}_{1:10} \rightarrow \hat{\text{x}}_{11:50}$), and 60 ($\text{x}_{1:10} \rightarrow \hat{\text{x}}_{11:70}$) time steps into the future. The metrics are computed frame-wise. Higher SSIM and PSNR scores indicate better results.}
\label{table:quantitativekth}
\end{table*}
\end{document}
附錄:
如果您喜歡在底部對齊表格和圖像,則只需新增選項[b]˙to insert4d table and at image remove option
valign=c`:
\documentclass[twocolumn]{article}
\usepackage[export]{adjustbox}
\usepackage{multirow}
\usepackage{siunitx}
\begin{document}
\begin{table*}
\centering
\setlength\tabcolsep{4pt}
\begin{tabular}{@{} lr @{}}
\small
\begin{tabular}[b]{@{} |l|l|cc|cc|cc|@{}}
\hline
\multirow{2}{*}{Type} & \multirow{2}{*}{Model} & \multicolumn{2}{c|}{$\text{x}_{1:10} \rightarrow \hat{\text{x}}_{11:30}$} & \multicolumn{2}{c|}{$\text{x}_{1:10} \rightarrow \hat{\text{x}}_{11:50}$} & \multicolumn{2}{c|}{$\text{x}_{1:10} \rightarrow \hat{\text{x}}_{11:70}$} \\
& & SSIM & PSNR & SSIM & PSNR & SSIM & PSNR \\
\hline
\multirow{3}{*}{Deterministic} \ & 2D ConvLSTM \cite{convlstm} & 0.712 & 23.58 & 0.639 & 22.85 & 0.551 & 20.13 \\
& PredRNN++ \cite{wang-predrnn} & 0.865 & 28.47 & 0.741 & 25.21 & 0.702 & 23.51 \\
& E3D-LSTM \cite{wang-e3d} & \textbf{0.879} & \textbf{29.31} & 0.810 & 27.24 & 0.798 & 26.82 \\
\hline
\multirow{2}{*}{Stochastic} & Variational 2D ConvLSTM \cite{vrnn} & 0.787 & 25.76 & 0.733 & 24.83 & 0.672 & 23.13 \\
& Variational 3D ConvLSTM (Ours) & 0.866 & 28.31 & \textbf{0.852} & \textbf{27.89} & \textbf{0.846} & \textbf{27.66} \\
\hline
\end{tabular}
&
\includegraphics[width=0.1\linewidth]{example-image-duck}
\end{tabular}
\caption{Results on the KTH action dataset when using 10 frames to predict 20 ($\text{x}_{1:10} \rightarrow \hat{\text{x}}_{11:30}$), 40 ($\text{x}_{1:10} \rightarrow \hat{\text{x}}_{11:50}$), and 60 ($\text{x}_{1:10} \rightarrow \hat{\text{x}}_{11:70}$) time steps into the future. The metrics are computed frame-wise. Higher SSIM and PSNR scores indicate better results.}
\label{table:quantitativekth}
\end{table*}
\end{document}