Here is my code:
Here is the output:
Why is the table on the bottom?
By default a tabular has its reference point at the left edge of its vertical center line, so the baseline of your figure runs through the baseline of the caption on the left and the cemtre of the tabular on the right.
If you used a caption on the right, or even \vspace*{0pt}
or used \begin{tabular}[b]
then the reference point would be below the tabular or (for [b]
) on its last line and so the alignment would be different.