子图对齐 - 想要水平对齐但垂直对齐

子图对齐 - 想要水平对齐但垂直对齐

我试图让下面的子图出现在同一行上。

\begin{figure*}[h!]
\centering

\begin{subfigure}[t]{\columnwidth}
    %\centering
    \subfloat[][]{\includegraphics[width=0.4555\textwidth]{histogram1.png}}
    %\caption{}
    \label{fig:histogram}
\end{subfigure}%

\hfil

\begin{subfigure}[t]{\columnwidth}
    %\centering
   \subfloat[h!][]{
   \begin{tabular}{@{}lr@{}} \toprule
        \multicolumn{2}{c}{RESIDUAL STATISTICS} \\ \midrule
        Mean & 0.000000 \\
        Median & -0.33816 \\
        Maximum & 10.54783 \\
        Minimum & -3.60859 \\
        Std. Dev. & 2.147995 \\
        Skewness & 2.801059 \\
        Kurtosis & 12.82719 \\ \midrule
        Jarque-Bera & 1530.2** \\ \midrule
        \begin{tabular}[c]{@{}l@{}}\,\,\,* significant at 5\% level\\ ** significant at 1\% level\end{tabular} & \multicolumn{1}{l}{}
    \end{tabular}
    }
    %\caption{} 
    \label{table:norm}
    }%\hfil
\end{subfigure}

\begin{minipage}[b]{0.4555\textwidth}
  \makeatletter
  \let\@makecaption=\old@makecaption
  \makeatother
  \caption{Blah blah blah}
\end{minipage}

\end{figure*}

这就是我的代码的显示方式。 在此处输入图片描述

答案1

不确定为什么要将subfigure和合并\subfloat

也用于siunitx对齐图形。

\documentclass[twocolumn]{article}
\usepackage{caption,subcaption}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{siunitx}

\begin{document}

\begin{figure*}
\centering
\sisetup{table-align-text-post=false}

\begin{subfigure}[b]{\columnwidth}
  \centering
  \includegraphics[width=\textwidth]{example-image-4x3}
  \caption{}\label{fig:histogram}
\end{subfigure}%
\hfil
\begin{subfigure}[b]{\columnwidth}
  \centering
  \begin{tabular}{@{}l S[table-format=-1.6,]@{}}
    \toprule
    \multicolumn{2}{c}{RESIDUAL STATISTICS} \\
    \midrule
    Mean & 0.000000 \\
    Median & -0.33816 \\
    Maximum & 10.54783 \\
    Minimum & -3.60859 \\
    Std. Dev. & 2.147995 \\
    Skewness & 2.801059 \\
    Kurtosis & 12.82719 \\
    \midrule
    Jarque-Bera & {1530.2**} \\
    \midrule[\heavyrulewidth]
    \multicolumn{2}{@{}l@{}}{\phantom{*}* significant at 5\% level}\\
    \multicolumn{2}{@{}l@{}}{** significant at 1\% level}
  \end{tabular}
  \caption{}\label{table:norm}
\end{subfigure}

\caption{Blah blah blah}\label{generallabel}
\end{figure*}

\end{document}

在此处输入图片描述

答案2

找到了解决办法:

\begin{figure}[h!]
\begin{minipage}[tl]{.49\linewidth}
\centering
\includegraphics[width=1.1\textwidth, height=7cm]{histogram1.png}
\end{minipage}
\hfill
\begin{minipage}[tr]{.5\linewidth}
\centering
\begin{tabular}{@{}lr@{}} \toprule
        \multicolumn{2}{c}{RESIDUAL STATISTICS} \\ \midrule
        Mean & 0.000000 \\
        Median & -0.33816 \\
        Maximum & 10.54783 \\
        Minimum & -3.60859 \\
        Std. Dev. & 2.147995 \\
        Skewness & 2.801059 \\
        Kurtosis & 12.82719 \\ \midrule
        Jarque-Bera & 1530.2** \\ \midrule
        \begin{tabular}[c]{@{}l@{}}\,\,\,* significant at 5\% level\\ ** significant at 1\% level\end{tabular} & \multicolumn{1}{l}{}
\end{tabular}
\end{minipage}
\caption{Histogram and Residual Statistics for \textit{rd}}
\label{figure:normality}

\end{figure}

在此处输入图片描述

相关内容