表と画像を同じ横長ページに配置する

表と画像を同じ横長ページに配置する

同じ横長のページに長い表と 3 つの画像を配置しようとしています。これが MWE です:

\documentclass[11pt]{article}

\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{lipsum}
\usepackage{pdflscape}
\usepackage{multirow}
\usepackage{afterpage}
\usepackage[a4paper, portrait, margin=1in]{geometry}

\begin{document}

\lipsum[1-2]

% want to put a table and images here

\afterpage{
\begin{landscape}
\begin{table}[ht]
    \small
    \centering
    \def\arraystretch{1.5}

    \begin{tabularx}{0.991\linewidth}{lccccccccccc} \toprule
         & \multicolumn{3}{c}{No Clustering} & \multicolumn{4}{c}{$K$-means Clustering} & \multicolumn{4}{c}{Hierarchical Clustering} \\ 
         & \multicolumn{3}{c}{--} & \multicolumn{4}{c}{$K=19$} & \multicolumn{4}{c}{$K=5$} \\   
         \cmidrule(r){2-4} \cmidrule(lr){5-8} \cmidrule(l){9-12}
         % this is what has to be replaced with xtable
         & Lasso & Elastic Net & pcLasso & gLasso & ogLasso & sgLasso & pcLasso & gLasso & ogLasso & sgLasso & pcLasso \\ \midrule
        \multirow{2}{*}{Parameters} & $\lambda = 0.0041$ & $\lambda = 0.0051$ & $\lambda = 0.0055$ & $\lambda = 0.0036$ & $\lambda = 0.078$ & $\lambda = 0.024$ & $\lambda = 0.0055$ & $\lambda = 0.0030$ & $\lambda = 0.078$ & $\lambda = 0.024$ & $\lambda = 0.0055$ \\ 
         & -- & $\alpha = 0.8$ & $\texttt{rat} = 1$ & -- & -- & $\alpha = 0.2$ & $\texttt{rat} = 0.9$ & -- & -- & $\alpha = 0.4$ & $\texttt{rat} = 0.95$ \\ %\addlinespace
        Misclass. & $5/36$ & $3/36$ & $2/36$ & $2/36$ & $14/36$ & $3/36$ & $2/36$ & $3/36$ & $14/36$ & $14/36$ & $2/36$ \\
        Deviance & $0.24$ & $0.083$ & $0.45$ & $0.18$ & $1.24$ & $1.46$ & $0.44$ & $0.28$ & $1.24$ & $1.46$ & $0.44$ \\
        Sig. Coef. & $14$ & $28$ & $16$ & $443$ & $1$ & $52$ & $76$ & $2714$ & $1$ & $772$ & $46$ \\
        Sig. Groups & -- & -- & -- & $1$ & $0$ & $1$ & $15$ & $2$ & $0$ & $1$ & $5$ \\ 
        %
        \bottomrule
    \end{tabularx}
    \caption{The performance of various models on the leukemia data set.}

\end{table}

\begin{figure}[ht]
    \centering
    \includegraphics[width = 0.48\textwidth]{img1.pdf}
    \includegraphics[width = 0.48\textwidth]{img2.pdf}
    \includegraphics[width = 0.48\textwidth]{img3.pdf}
    \caption{The ROC curves for the leukemia data set.}
    \label{leuk_ROC}
\end{figure}

\end{landscape}
}

\lipsum[3-7]

\end{document}

目標は、テーブルをページ全体に広げ、その下に 3 つの画像を並べることです。ただし、結果は次のようになります。

ここに画像の説明を入力してください

明らかに、それは機能しませんでした。これを修正する方法について何か提案はありますか?

編集

コードに少し修正を加えて出力を変更しました。しかし、問題は依然として残っています。

答え1

表と図の両方を に置き換える[ht]だけで、1 つの横長ページに収まりました。 (は、欠落している画像を無視するために追加されています。)[p]draft

\documentclass[11pt,draft]{article}

\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{lipsum}
\usepackage{pdflscape}
\usepackage{multirow}
\usepackage{afterpage}
\usepackage[a4paper, portrait, margin=1in]{geometry}

\begin{document}

\lipsum[1-2]

% want to put a table and images here

\afterpage{
\begin{landscape}
\begin{table}[p]
    \small
    \centering
    \def\arraystretch{1.5}

    \begin{tabularx}{0.991\linewidth}{lccccccccccc} \toprule
         & \multicolumn{3}{c}{No Clustering} & \multicolumn{4}{c}{$K$-means Clustering} & \multicolumn{4}{c}{Hierarchical Clustering} \\ 
         & \multicolumn{3}{c}{--} & \multicolumn{4}{c}{$K=19$} & \multicolumn{4}{c}{$K=5$} \\   
         \cmidrule(r){2-4} \cmidrule(lr){5-8} \cmidrule(l){9-12}
         % this is what has to be replaced with xtable
         & Lasso & Elastic Net & pcLasso & gLasso & ogLasso & sgLasso & pcLasso & gLasso & ogLasso & sgLasso & pcLasso \\ \midrule
        \multirow{2}{*}{Parameters} & $\lambda = 0.0041$ & $\lambda = 0.0051$ & $\lambda = 0.0055$ & $\lambda = 0.0036$ & $\lambda = 0.078$ & $\lambda = 0.024$ & $\lambda = 0.0055$ & $\lambda = 0.0030$ & $\lambda = 0.078$ & $\lambda = 0.024$ & $\lambda = 0.0055$ \\ 
         & -- & $\alpha = 0.8$ & $\texttt{rat} = 1$ & -- & -- & $\alpha = 0.2$ & $\texttt{rat} = 0.9$ & -- & -- & $\alpha = 0.4$ & $\texttt{rat} = 0.95$ \\ %\addlinespace
        Misclass. & $5/36$ & $3/36$ & $2/36$ & $2/36$ & $14/36$ & $3/36$ & $2/36$ & $3/36$ & $14/36$ & $14/36$ & $2/36$ \\
        Deviance & $0.24$ & $0.083$ & $0.45$ & $0.18$ & $1.24$ & $1.46$ & $0.44$ & $0.28$ & $1.24$ & $1.46$ & $0.44$ \\
        Sig. Coef. & $14$ & $28$ & $16$ & $443$ & $1$ & $52$ & $76$ & $2714$ & $1$ & $772$ & $46$ \\
        Sig. Groups & -- & -- & -- & $1$ & $0$ & $1$ & $15$ & $2$ & $0$ & $1$ & $5$ \\ 
        %
        \bottomrule
    \end{tabularx}
    \caption{The performance of various models on the leukemia data set.}

\end{table}

\begin{figure}[p]
    \centering
    \includegraphics[width = 0.48\textwidth]{img1.pdf}
    \includegraphics[width = 0.48\textwidth]{img2.pdf}
    \includegraphics[width = 0.48\textwidth]{img3.pdf}
    \caption{The ROC curves for the leukemia data set.}
    \label{leuk_ROC}
\end{figure}

\end{landscape}
}

\lipsum[3-7]

\end{document}

ここに画像の説明を入力してください

関連情報