3

I need to place a table just below a figure in a single page. The table is an explanation of figure so it should not move to next page. I am expecting figure and table at the middle of the page. Please help me

\documentclass[a4paper,12pt]{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[h]
\includegraphics[width=1\textwidth,totalheight=0.6\textheight]{my figure}
\label{fig.1}
\end{figure}
\begin{center}
\begin{tabular}{|l|l|l|l|l|l|}
\hline
Channel No &1&2&3&4&5\\
\hline
Wavelength ($\mu$m) &7.43&11.03&12.02&12.66&14.08\\
\hline
\end{tabular}
\end{center}
\end{document}
  • 2
    Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Stefan Pinnow Feb 27 '18 at 5:22
  • 2
    insert table in figure environment ... provide mwe that we can show you how to do this. – Zarko Feb 27 '18 at 5:29
  • In LaTeX, one needs to distinguish between two senses or meanings of the term "table". It can mean either a floating environment called table, or it can mean a tabular-like environment. It sounds like you're using the latter meaning. If so, just include the explanatory material (in tabular form) inside the figure environment. – Mico Feb 27 '18 at 5:54
3

Unless the "explanatory table" should have its own, separate \caption, you needn't do anything special. Just include the tabular material inside the figure environment. More specifically, (a) start the figure environment, (b) insert the graph (via an \includegraphics or similar statement), (c) insert a tabular-like environment, (d) provide a \caption statement, either at the top or bottom of the figure environment, and (e) end the figure environment.


Update, after the OP posted an MWE (minimum working example). The preceding suggestion applies to your case. The only addition is that I'd insert either \medskip or \bigskip between the end of the graph and the start of the tabular environment.

\documentclass[a4paper,12pt]{article}
\usepackage[demo]{graphicx} % remove 'demo' option in real document
\usepackage{siunitx} % for '\si' macro
\usepackage{array}   % for '\extrarowheight' macro
\begin{document}

\begin{figure}[h]
\setlength\extrarowheight{2pt} % for a less-cramped "look"
\centering
\caption{Some result} \label{fig.1}

\medskip
\includegraphics[width=1\textwidth,height=0.6\textheight]{my figure}

\bigskip
\begin{tabular}{|l|l|l|l|l|l|}
\hline
Channel No &1&2&3&4&5\\
\hline
Wavelength (\si{\micro\meter}) &7.43&11.03&12.02&12.66&14.08\\
\hline
\end{tabular}

\end{figure}
\end{document}

enter image description here

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.