Vertical alignment of graphic and tabular
Whether you want both objects aligned at the top or at the bottom, you can use two minipage
environments and apply the \vspace{0pt}
trick to obtain the desired vertical alignment (a quirk of TeX/LaTeX).
See also Understanding minipages - aligning at top for more details.
Set the optional argument to both minipage
environments to
t
for top alignment,b
for bottom alignment.
Note: I've used tikzpicture
environment as placeholder for your graph, as you didn't provide the code for that.
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{tikz}
\begin{document}
\begin{minipage}[t]{.5\textwidth}
\vspace{0pt}
\raggedleft
\begin{tikzpicture}
\filldraw[draw=red,fill=red!20] rectangle (3,3);
\end{tikzpicture}
\vspace{0pt}
\end{minipage}
\begin{minipage}[t]{.5\textwidth}
\vspace{0pt}
\raggedright
\begin{tabular}{ll}
p: 78\%&\\\\
$\mu$: -7\% & $\sigma$: 7\%\\
$\alpha$: 0.43 & N: 11977
\end{tabular}
\vspace{0pt}
\end{minipage}
\end{document}
You can use the adjustbox
package which does all the work without you setting any length. Just change the mock tikzpicture
with your plot.
\documentclass{article}
\usepackage{tikz}
\usepackage{adjustbox}
\begin{document}
\section{Centered alignment}
\begin{adjustbox}{valign=c}
\begin{tikzpicture}
\filldraw[draw=red,fill=red!20] rectangle (3,3);
\end{tikzpicture}
\end{adjustbox}
\begin{tabular}{ll}
p: 78\%&\\[2ex]
$\mu$: -7\% & $\sigma$: 7\%\\
$\alpha$: 0.43 & N: 11977
\end{tabular}
\section{Top alignment}
\begin{adjustbox}{valign=t}
\begin{tikzpicture}
\filldraw[draw=red,fill=red!20] rectangle (3,3);
\end{tikzpicture}
\end{adjustbox}
\begin{tabular}[t]{ll}
p: 78\%&\\[2ex]
$\mu$: -7\% & $\sigma$: 7\%\\
$\alpha$: 0.43 & N: 11977
\end{tabular}
\section{Bottom alignment}
%\begin{adjustbox}{valign=b} % adjustbox not really needed
\begin{tikzpicture}
\filldraw[draw=red,fill=red!20] rectangle (3,3);
\end{tikzpicture}
%\end{adjustbox}
\begin{tabular}[b]{ll}
p: 78\%&\\[2ex]
$\mu$: -7\% & $\sigma$: 7\%\\
$\alpha$: 0.43 & N: 11977
\end{tabular}
\end{document}