2
  \begin{figure}[htbp]
    \centering
    \makebox[0.5\textwidth]{\includegraphics[width=0.7\textwidth]{figure/ch3/result_s2/book.jpg}}
    \qquad \qquad
        \scalebox{0.7}{
    \begin{tabular}[c]{cc}
    \hline
      \textbf{Method} & \textbf{$\sigma$} \\ \hline
      method 1 & 0.0 \\
      method 2 & 0.1 \\
      method 3 & 0.2 \\ \hline
    \end{tabular}}
  \end{figure}

Please help!, Thanks

2

Something like this? enter image description here

Code:

    \documentclass{article}
    \usepackage{graphicx}

   \usepackage[active,floats,tightpage]{preview}
   \setlength\PreviewBorder{5mm}

        \begin{document}
    \begin{figure}
        \centering
        \raisebox{-13mm}{
    \includegraphics[width=0.5\textwidth]{example-image}
                        }
        \hfil
        \begin{tabular}[b]{cc}
        \hline
          \textbf{Method} & \textbf{$\sigma$} \\ \hline
          method 1 & 0.0 \\
          method 2 & 0.1 \\
          method 3 & 0.2 \\ \hline
        \end{tabular}
    \caption{May figure accompanied with table}
    \end{figure}
        \end{document}

For vertical centering I use \raisebox. Amount for lowering of figure you need select according to size of original picture.

2

Use \raisebox{-0.5\height}{...}, so the image will be vertically centered without any need to guess at its height.

\documentclass{article}
\usepackage{graphicx}

\begin{document}

\begin{figure}[htbp]
\centering

\raisebox{-.5\height}{%
  \includegraphics[width=0.7\textwidth]{example-image}%
}\hfill
{\footnotesize
 \begin{tabular}[c]{cc}
 \hline
 \textbf{Method} & \textbf{$\sigma$} \\ \hline
 method 1 & 0.0 \\
 method 2 & 0.1 \\
 method 3 & 0.2 \\ \hline
 \end{tabular}}
\end{figure}

\end{document}

Avoid \scalebox in this case: choosing \footnotesize is better.

enter image description here

  • Good to know, that the height of image can be used outside of \includegraphics. – Zarko May 28 '15 at 13:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.