将图表与表格并排放置

将图表与表格并排放置

我有一张表格和一幅图形,我想将它们一个挨着一个地对齐(而不是一个在另一个下面):

\documentclass{llncs}
\usepackage{capt-of}
\usepackage[demo]{graphicx}
\begin{document}


\begin{table}[t]
\begin{minipage}[t]{.5\textwidth }
\footnotesize
\begin{tabular}{ | c || c | c | c | c | } \hline
\textbf{ABC} & \textbf{KO} & \textbf{Ro} & \textbf{Ov} & \textbf{Params} \\ \hline
\multicolumn{5}{|c|}{\textbf{Well this is a text here}} \\ \hline
\textit{A1} & 123 & 123 & 123 & 123 \\ \hline
\textit{Z2} & 123 & 123 & 123 & 123 \\ \hline
\multicolumn{5}{|c|}{\textbf{Well this is another text here)}} \\ \hline
\textit{O1} & 123 & 123 & 123 & 123 \\ \hline
\textit{U9} & 123 & 123 & 123 & 123 \\ \hline
\end{tabular}
\caption{results in this table}
\label{validation}
\end{minipage}%
\begin{minipage}[t]{.5\textwidth}
\includegraphics[width=0.45\textwidth]{plot.pdf}
\caption{This is a figure not a table}
\label{plot}
\end{minipage}
\end{table}

\end{document}

答案1

假设平均能量损失您可以执行以下操作:

\documentclass{book}
\usepackage{capt-of}
\usepackage[demo]{graphicx}
\begin{document}


\begin{table}[t]
    \begin{minipage}[t]{.5\textwidth }
        \footnotesize
        \begin{tabular}{ | c || c | c | c | c | } \hline
            &\\
        \end{tabular}
        \caption{the caption of table}
        \label{thelabeltab}
    \end{minipage}%
    \begin{minipage}[t]{.5\textwidth}
        \includegraphics[width=0.45\textwidth]{myimage.pdf}
        \captionof{figure}{my caption goes here}
        \label{thelab}
    \end{minipage}
\end{table}

\end{document}

在此处输入图片描述

capt-of当不需要使用 KOMAScript 类时。如果示例对您没有帮助,我建议您提供一个平均能量损失

更新: 下面是一个扩展示例,其中包含一些(调试)框架,向您展示两个对象的位置。(当您将此示例与上例进行比较时,您会很容易地找出要删除哪些命令才能消除这些线条。)

\documentclass{book}
\usepackage{capt-of, showframe, blindtext}
\usepackage[demo]{graphicx}
\begin{document}
\blindtext

\begin{table}[t]\fbox{
\begin{minipage}[b]{.50\textwidth }%
\footnotesize
\begin{tabular}{ | c || c | c | c | c | } \hline
\textbf{ABC} & \textbf{KO} & \textbf{Ro} & \textbf{Ov} & \textbf{Params} \\ \hline
\multicolumn{5}{|c|}{\textbf{Well this is a text here}} \\ \hline
\textit{A1} & 123 & 123 & 123 & 123 \\ \hline
\textit{Z2} & 123 & 123 & 123 & 123 \\ \hline
\multicolumn{5}{|c|}{\textbf{Well this is another text here)}} \\ \hline
\textit{O1} & 123 & 123 & 123 & 123 \\ \hline
\textit{U9} & 123 & 123 & 123 & 123 \\ \hline
\end{tabular}%
\caption{results in this table}\label{validation}%
\end{minipage}}%
\fbox{\begin{minipage}[b]{.45\textwidth}%
\hspace*{0pt}\includegraphics[width=0.45\textwidth]{plot.pdf}%
\captionof{figure}{This is a figure not a table\label{x}}%
\end{minipage}}
\end{table}

\end{document}

在此处输入图片描述

相关内容