# Adjusting Figures (Floats) Next to Tables

I am wondering what is the best way to place floats directly across from a array or tabular environment. I want to get the graph to show on the right of the table of values. A picture is shown below along with a MWE.

\documentclass[12pt,letterpaper]{article}
\usepackage[margin=2.0cm]{geometry}
\usepackage{amsmath}

\begin{document}

$\begin{array}{rr} -7.0 & 7.0 \\ -6.0 & 0.067 \\ -5.0 & -4.9 \\ -4.0 & -7.7 \\ -3.0 & -7.9 \\ -2.0 & -2.9 \\ -1.0 & 39. \\ 0 & 87. \\ 1.0 & 50. \\ 2.0 & 21. \\ 3.0 & 28. \\ 4.0 & 40. \\ 5.0 & 55. \\ 6.0 & 72. \\ 7.0 & 91. \end{array}$

\begin{figure}[h!]
\centering
\scalebox{0.5}{
\includegraphics{hx.pdf}
}
\caption{Plot of the function $$h(x)$$}
\end{figure}

\end{document}


-

If you want the caption to encompass only the graph, then something like this could be what you want:

\documentclass[12pt]{article}
\usepackage[margin=2.0cm]{geometry}
\usepackage[demo]{graphicx}
\usepackage{amsmath,caption}

\begin{document}

\begin{figure}
\centering
\hspace*{\fill}$\begin{array}{rr} -7.0 & 7.0 \\ -6.0 & 0.067 \\ -5.0 & -4.9 \\ -4.0 & -7.7 \\ -3.0 & -7.9 \\ -2.0 & -2.9 \\ -1.0 & 39. \\ 0 & 87. \\ 1.0 & 50. \\ 2.0 & 21. \\ 3.0 & 28. \\ 4.0 & 40. \\ 5.0 & 55. \\ 6.0 & 72. \\ 7.0 & 91. \end{array}$\hfill
\begin{minipage}{.5\textwidth}
\centering
\includegraphics[width=.45\textwidth]{hx.pdf}
\caption{Plot of the function $$h(x)$$}
\end{minipage}\hspace*{\fill}
\end{figure}

\end{document}


Note the use of graphicx and its extended syntax, that avoids the \scalebox command (the demo option is just to produce the example without needing a file). Adjust to suit.

-

Include your array inside the figure:

\begin{figure}[h!]
\centering
$\begin{array}{rr} -7.0 & 7.0 \\ -6.0 & 0.067 \\ -5.0 & -4.9 \\ .............. 7.0 & 91. \end{array}$
\caption{Plot of the function $$h(x)$$}

While you're at it, maybe you want to change that array into a tabular, and add a couple \hlines, and/or use the package booktabs.
Then you probably want to have a look at the wrapfig package, and use the wrapfigure environment. –  Koji Jan 30 '12 at 13:12