垂直子表未正确对齐

垂直子表未正确对齐

我在表格环境中有 4 个子表格。子表格太靠右,子表格的子标题也没有位于子表格下方的中央。如能得到任何帮助,我将不胜感激。

在此处输入图片描述

\begin{table} [htp]
    \centering
    \begin{subtable}[c]{.5\textwidth}
        \centering
        \begin{tabular}{|c|c|c|c|c|c|}
            \hline Class & Recall & FP & Precision & F-Measure & MCC \\
            \hline normal      &    0.924     &  0.380  &   0.648        &   0.762        &  0.554   \\
            \hline anomaly      & 0.620       &  0.076  &    0.915       &    0.739       &  0.554    \\
            \hline
            Weighted Avg. & 0.751 & 0.207 & 0.800 & 0.749 & 0.554 \\
            \hline
        \end{tabular}
        \caption{SVM-Linear Performance Metrics \label{tbl:svmlinearaccuracy}}
        \vspace{10mm}           
    \end{subtable}
\quad%  
    \begin{subtable}[c]{.5\textwidth}
        \centering
        \begin{tabular}{|c|c|c|c|c|c|}
            \hline Class & Recall & FP & Precision & F-Measure & MCC \\
            \hline normal      &    0.967     &  0.391  &   0.652        &   0.779        &  0.594   \\
            \hline anomaly      & 0.609       &  0.033  &    0.961       &    0.745       &  0.594    \\
            \hline
            Weighted Avg. & 0.763 & 0.187 & 0.828 & 0.760 & 0.594 \\
            \hline
        \end{tabular}
        \caption{SVM-Polynomial Performance Metrics \label{tbl:svmpolynomialaccuracy}}
        \vspace{10mm}           
    \end{subtable}
\quad%   
    \begin{subtable}[c]{.5\textwidth}
        \centering
        \begin{tabular}{|c|c|c|c|c|c|}
            \hline Class & Recall & FP & Precision & F-Measure & MCC \\
            \hline normal      &    0.925     &  0.403  &   0.635       &   0.753        &  0.534   \\
            \hline anomaly      & 0.597       &  0.075  &    0.913       &    0.722       &  0.534    \\
            \hline
            Weighted Avg. & 0.738 & 0.216 & 0.793 & 0.735 & 0.534 \\
            \hline
        \end{tabular}
        \caption{SVM Sigmoid Performance Metrics \label{tbl:svmsigmoidaccuracy}}
        \vspace{10mm}
    \end{subtable}
\quad%  
    \begin{subtable}[c]{.5\textwidth}
        \centering
        \begin{tabular}{|c|c|c|c|c|c|}
            \hline Class & Recall & FP & Precision & F-Measure & MCC \\
            \hline normal      &    0.924     &  0.409  &   0.631       &   0.750        &  0.528   \\
            \hline anomaly      & 0.591       &  0.076  &    0.911       &    0.717       &  0.528    \\
            \hline
            Weighted Avg. & 0.734 & 0.220 & 0.790 & 0.731 & 0.528 \\
            \hline
        \end{tabular}
        \caption{SVM RBF Performance Metrics \label{tbl:svmrbfaccuracy}}
        \vspace{10mm}
    \end{subtable}  
    \caption{Main Table}
\end{table}

答案1

您的表格包含的子表格太宽,一行上放不下两个。而且它们对于 来说太宽了.5\textwidth。因此,您应该将子表格宽度增加到\textwidth并删除\quad宏(用 替换它们\\)。

那么格式应该正确。实际上格式正确,因为标题在 上居中.5\textwidth

相关内容