To maximize space, I'm trying to put an table and image side-by-side in a document. As the image is longer than the table, I want to put both captions under the table (if possible). I envisage this looking something like as follows.
I've followed the steps in this example. However I can't find a way to move the figure caption under the table. Here is some working code:
\documentclass{article}
\usepackage[demo]{graphicx} % for inclusion of graphics
\usepackage{floatrow}
\newfloatcommand{capbtabbox}{table}[][\FBwidth]
\usepackage{booktabs}
\begin{document}
\begin{figure}[t]
\begin{floatrow}
\TopFloatBoxes
\capbtabbox{
\begin{tabular}{ccc} \toprule
Heading 1 & Heading 2 & Heading 3 \\ \midrule
1 & $\{1\}$ & A \\
2 & $\{1,2\}$ & B \\
3 & $\{1,2,3\}$ & C \\
4 & $\{1,2,3,4\}$ & D \\
5 & $\{1,2,3,4,5\}$ & E \\
6 & $\{1,2,3,4,5,6\}$ & F \\
7 & $\{1,2,3,4,5,6,7\}$ & G \\
8 & $\{1,2,3,4,5,6,7,8\}$ & H \\
9 & $\{1,2,3,4,5,6,7,8,9\}$ & I \\
10 & $\{1,2,3,4,5,6,7,8,9,10\}$ & J \\ \bottomrule
\end{tabular}
}{
{\caption{A caption for a table in a figure and a table side by side}\label{fig:test}}
}
\ffigbox{
\includegraphics[height=8cm]{Images/preNet.pdf}
}{
{\caption{A caption for a figure in a figure and a table side by side}\label{fig:test}}
}
\end{floatrow}
\end{figure}
\end{document}