# An alternative way to align figure and table in \subfloat

So I realise this has been asked/alluded to a couple of times previously as in:

Figure and table side-by-side in subfloats

Table and Figure side-by-side with Table caption above, Figure caption below

Where ultimately it seems some issues may arise due to bad captioning or use of hyperref, though exactly why still isn't overly clear to me. Nevertheless, I'm not using hyperref and am trying to achieve 4 (or maybe even greater) panel of images, with an inset table.

I was following the approach of this link, by defining my table as a command object, but its still not playing ball.

I currently have this:

and would like all 4 (technically 5 since the graph legend is an image I've tacked in) to sit in panels 2 below 2 - effectively, the table needs to come up a couple of centimetres. The most promising avenue of approach I think was probably the \raisebox as mentioned in one of the answers, but either it won't work or I'm muddling the syntax. It was throwing me some TeX capacity exceeded error.

I'll try to give a MWE, but as I'm not really sure where my error is coming from, I don't know entirely what will be relevant and not. Oh I should probably point out that I'm using the Royal Society of Chemistry's template too (no choice!).

\documentclass[8.5pt, oneside, twocolumn]{article}
\oddsidemargin -1.2cm
\evensidemargin -1.2cm
\textwidth 18cm
\topmargin -3.5cm
\textheight 22cm
\usepackage{pbox}
\usepackage{xcolor,colortbl}
\usepackage{subfig}
\usepackage[demo]{graphicx}
\usepackage[hyphens]{url} % Included for the sake of completeness since hyperref had caused similar problems in the other threads. Doubt this is the source of the issue though.
\usepackage[format=plain,
justification=raggedright,
singlelinecheck=false,
font=small,labelfont=bf,
labelsep=space]{caption} % A 'default' caption to use unless specified otherwise by me

\begin{document}

% Defining my table object for calling to subfloat:

\newcommand{\slopetable}{
\footnotesize
\begin{tabular*}{0.43\textwidth}{llll}
\hline    \\[-1.7ex]
Assay & \pbox{1.2cm}{Linear regression coefficient (3 s. f.)} & \pbox{1.2cm}{Normalised linear regression coefficient (3 s. f.)} & \pbox{1cm}{Activity (\%)}  \\
\\[-2ex]
\hline
\\[-1.5ex]
WT MeOH PTC          & 0.308    & 1.00  & 100   \\
WT Tunicamycin       & 0.374    & 1.21  &  121  \\
F288W Tunicamycin    & 0.382    & 1.24  &  124  \\
\\[-1.5ex]
F288W E-peptide [37] & 0.402    & 1.30  & 130   \\
F288W E-peptide [62] & 0.223    & 0.742 & 74.2  \\
F288W E-peptide [83] & 0.820    & 2.66  & 266   \\
\\[-1.5ex]
F288W RWGLW [166]    & 0.409    & 1.32  &  132  \\
F288W RWGLW [416]    & 0.304    & 0.985 &  98.5 \\
F288W RWGLW [624]    & 0.276    & 0.896 &  89.6 \\
\\[-1.5ex]
F288W GW-Oct [83]   & 0.209  &  0.677   & 67.7  \\
F288W GW-Oct [166]  & 0.0194 &  0.0630  & 6.30  \\
F288W GW-Oct [416]  & 0.0510 & 0.165    & 16.5  \\
\\[-0.5ex]
\hline
\end{tabular*}
}

% Begin constructing multi-panel figure:

\begin{figure*}[t]
\subfloat[{Dummy caption 1.}\label{rawdata}]{
\includegraphics[width=0.40\textwidth,clip=true,trim=0 0 20 25]{Raw_data_plot_8x11}}
\subfloat[{Dummy caption 2.}\label{smoothdata}]{
\includegraphics[width=0.40\textwidth,clip=true,trim=0 0 20 25]{Smoothed_data_plot_8x11}}
\captionsetup[subfigure]{labelformat=empty} % Butchering duplicate graph to obtain an un-captioned image at the far right
\subfloat[]{%
\includegraphics[width=0.19\textwidth,clip=true, trim= 655 155 0 150 ]{Plot_for_legend}}

% Beginning of panel causing issues
\subfloat[][]{\slopetable}
\subfloat[{}\label{LinearRegression}]{%
\includegraphics[width=0.5\textwidth,clip=true, left, trim= 0 0 0 0]{Linear_regression_plot}}

\captionsetup{singlelinecheck=off, justification=justified}
\caption{
Temp placeholder caption}

\end{figure*}

\end{document}


I hope that's enough to go on for now at least - any help would be great. I'd ideally like to avoid bodging it with minipages and so on if possible though.

EDIT - Somewhat tweaked MWE that replicates the problem, left the original one there incase a solution is found that directly relates to that code.

\documentclass[8.5pt, oneside, twocolumn]{article}
\oddsidemargin -1.2cm
\evensidemargin -1.2cm
\textwidth 18cm
\topmargin -3.5cm
\textheight 22cm
\usepackage{pbox}
\usepackage{calc}
\usepackage{xcolor,colortbl}
\usepackage{subfig}
\usepackage[demo]{graphicx}
\usepackage[hyphens]{url} % Included for the sake of completeness since hyperref had caused similar problems in the other threads. Doubt this is the source of the issue though.
\usepackage[format=plain,
justification=raggedright,
singlelinecheck=false,
font=small,labelfont=bf,
labelsep=space]{caption} % A 'default' caption to use unless specified otherwise by me

\begin{document}

% Defining my table object for calling to subfloat:

\newcommand{\slopetable}{
\footnotesize
\begin{tabular*}[b]{0.43\textwidth}{llll}
\hline    \\[-1.7ex]
Assay & \pbox{1.2cm}{Linear regression coefficient (3 s. f.)} & \pbox{1.2cm}{Normalised linear regression coefficient (3 s. f.)} & \pbox{1cm}{Activity (\%)}  \\
\\[-2ex]
\hline
\\[-1.5ex]
WT MeOH PTC          & 0.308    & 1.00  & 100   \\
WT Tunicamycin       & 0.374    & 1.21  &  121  \\
F288W Tunicamycin    & 0.382    & 1.24  &  124  \\
\\[-1.5ex]
F288W E-peptide [37] & 0.402    & 1.30  & 130   \\
F288W E-peptide [62] & 0.223    & 0.742 & 74.2  \\
F288W E-peptide [83] & 0.820    & 2.66  & 266   \\
\\[-1.5ex]
F288W RWGLW [166]    & 0.409    & 1.32  &  132  \\
F288W RWGLW [416]    & 0.304    & 0.985 &  98.5 \\
F288W RWGLW [624]    & 0.276    & 0.896 &  89.6 \\
\\[-1.5ex]
F288W GW-Oct [83]   & 0.209  &  0.677   & 67.7  \\
F288W GW-Oct [166]  & 0.0194 &  0.0630  & 6.30  \\
F288W GW-Oct [416]  & 0.0510 & 0.165    & 16.5  \\
\\[-0.5ex]
\hline
\end{tabular*}
}

% Begin constructing multi-panel figure:

\begin{figure*}[t]
\subfloat[{Dummy caption 1.}\label{rawdata}]{
\includegraphics[width=0.40\textwidth,clip=true,trim=0 0 20 25]{Raw_data_plot_8x11}}
\subfloat[{Dummy caption 2.}\label{smoothdata}]{
\includegraphics[width=0.40\textwidth,clip=true,trim=0 0 20 25]{Smoothed_data_plot_8x11}}
\captionsetup[subfigure]{labelformat=empty}
\subfloat[]{%
\includegraphics[width=0.1\textwidth,clip=true, trim= 655 155 0 150 ]{Plot_for_legend}}

% Beginning of panel causing issues
\subfloat[][]{\slopetable}
\subfloat[{}\label{LinearRegression}]{%
\includegraphics[height=5cm, draft]{Linear_regression_plot}}

\end{figure*}

\end{document}


Which produces:

• your tabular has the default [c] position so its baseline goes through its centre, which is why the centre of the table is aligned with the base of the image you want \begin{tabular}[b] – David Carlisle Sep 11 '14 at 21:08
• I had originally thought this too, but upon trying it, I get a 'missing number treated as zero' error in (according to TeX at least) the \subfloat[][] line. – Joe Healey Sep 11 '14 at 21:20
• most likely you did something wrong then:-) please fix your example so it is a complete document so that people can see the issue. use \usepackage[demo]{graphicx} so we don't need the images and add \end[document} – David Carlisle Sep 11 '14 at 21:24
• Oh yeah missed that, will append now. – Joe Healey Sep 11 '14 at 21:39
• the example generates ! Package keyval Error: left undefined. – David Carlisle Sep 11 '14 at 21:51

Your tabular has the default [c] position so its baseline goes through its centre, which is why the centre of the table is aligned with the base of the image you want: \begin{tabular}[b] or more exactly as you are using tabular* :
 \begin{tabular*}[b]{0.43\textwidth}{llll}

which will line the baseline of the bottom row (or \hline in this case) of the tabular with the base of the image.