I would like to place a table and figure side by side in my document. I have achieved this with the following code
\documentclass[a4paper,10pt]{article}
\usepackage{floatrow}
\usepackage{color}
\newfloatcommand{capbtabbox}{table}[][\FBwidth]
\begin{document}
\begin{figure}
\begin{floatrow}
\ffigbox[\FBwidth]%
{\includegraphics*[width=0.45\textwidth]{LiverPhantom.png}}
{\caption{Liver Phantom}%
\label{fig:Zoom}%
}
\capbtabbox{%
\begin{tabular}{|c|cc|cc|cc|} \hline
\textbf{Head} & \multicolumn{6}{c|}{\textbf{Pixel Width}} \\ \hline
& \multicolumn{2}{c|}{\textbf{Picker}} & \multicolumn{2}{c|}{\textbf{Blue}} & \multicolumn{2}{c|}{\textbf{Red}} \\
& X & Y & X & Y & X & Y \\ \hline
\textbf{H1} & 79.9 & 80.0 & 87.3 & 87.5 & 87.7 & 87.1 \\
\textbf{H2} & 79.4 & 79.3 & 87.5 & 87.1 & 87.3 & 87.2 \\
\textbf{H3} & 80.2 & 80.4 & - & - & - & -\\ \hline
\textbf{Mean} & \multicolumn{2}{c|}{\textbf{\color{red}79.9}} & \multicolumn{4}{c|}{\textbf{\color{red}87.3}} \\ \hline
\end{tabular}
}{
\caption{Phantom pixel width}
\label{fig:ZoomTBl}
}
\end{floatrow}
\end{figure}
\end{document}
However, the bottom boundaries of the figure and table have the same y-coordinate. Is it possible to align the table vertically centre with respect to the figure?
Best Answer
Although Herbert solved the question, it is worth to note that and easy alternative are two clasic
minipage
s and thecaption
package: