Graphics, Figures & TablesTwo questions conserning Tables and Figures

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Nardo
Posts: 9
Joined: Sun Nov 21, 2010 5:22 pm

Two questions conserning Tables and Figures

Post by Nardo »

Code: Select all

\documentclass[12pt]{article}
%\usepackage[ngerman]{babel}
%\usepackage{a4wide}
\usepackage{setspace}

\usepackage{geometry}
\geometry{a4paper, top=25mm, left=25mm, right=25mm, bottom=25mm}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{float}
\usepackage{lscape}
\usepackage{color}
\newcommand{\WichtigFarbe}{\color{blue}}%
\newcommand{\magenta}{\color{magenta}}%
\newcommand{\TextFarbe}{\color{black}}%
\definecolor{darkblue}{rgb}{0,0,0.5}
\definecolor{darkred}{rgb}{0.5,0,0}
\usepackage[colorlinks=true, pdfstartview=FitV, linkcolor=darkred,
            citecolor=darkblue, urlcolor=red]{hyperref}
\usepackage{appendix}
\usepackage[round]{natbib}
%\usepackage{chicago}
%\usepackage{harvard}
\usepackage[hang,small,bf]{caption}
\usepackage{amsmath, amssymb}
\usepackage[ansinew]{inputenc}
\usepackage{longtable}
\usepackage[hang,small,bf]{caption}
\usepackage{url}
\usepackage{booktabs}
\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}
\usepackage[T1]{fontenc}
%\usepackage{setspace} %\onehalfspacing
%\usepackage{vmargin}
\usepackage{fancyhdr}
\usepackage{threeparttable}


\begin{document}

\pagenumbering{Roman}
\begin{titlepage}


My problem is that the tables and graphs are not where they should be.

Code: Select all

Table 1, for the world in Table 2,
and for China in Table 3.
\begin{table}[htbp]\centering \caption{Descriptive statistics for OECD countries, 1982-2008 \label{sumstat}}
\begin{threeparttable}
\begin{tabular}{l c c c c c}\hline\hline
\multicolumn{1}{c}{\textbf{Variables}} & \textbf{Mean}
 & \textbf{(Std. Dev.)}& \textbf{Minimum} &  \textbf{Maximum} & \textbf{N}\\ \hline
Total imports from China in USD (\emph{log}) & 20.826 & (2.311) & 14.31 & 26.599 & 695\\
Physical Integrity Rights Index & 6.95 & (1.481) & 0 & 8 & 695\\
GDP in current USD (\emph{log}) & 26.272 & (1.629) & 21.726 & 30.296 & 695\\
Total population (\emph{log}) & 16.486 & (1.606) & 12.363 & 19.534 & 695\\
Distance\tnote{I} (\emph{log}) & 8.924 & (0.417) & 6.862 & 9.431 & 695\\
\hline
\end{tabular}
\begin{tablenotes}\footnotesize
\item[I] simple distance of most populated cities to most populated Chinese cities in kilometers.
\end{tablenotes}
\end{threeparttable}
\end{table}
\begin{table}[htbp]\centering \caption{Descriptive statistics for the world, 1982-2008 \label{sumstat}}
\begin{threeparttable}
\begin{tabular}{l c c c c c}\hline\hline
\multicolumn{1}{c}{\textbf{Variables}} & \textbf{Mean}
 & \textbf{(Std. Dev.)}& \textbf{Minimum} &  \textbf{Maximum} & \textbf{N}\\ \hline
Total imports from China in USD (\emph{log}) & 18.256 & (2.977) & 6.475 & 26.6 & 3397\\
Physical Integrity Rights Index & 5.31 & (2.184) & 0 & 8 & 2869\\
GDP in current USD (\emph{log}) & 23.657 & (2.346) & 16.839 & 30.296 & 3191\\
Total population (\emph{log}) & 15.564 & (2.072) & 9.253 & 20.854 & 3260\\
Distance\tnote{I} (\emph{log}) & 9.022 & (0.523) & 6.862 & 9.868 & 3397\\
\hline
\end{tabular}
\begin{tablenotes}\footnotesize
\item[I] simple distance of most populated cities to most populated Chinese cities in kilometers.
\end{tablenotes}
\end{threeparttable}
\end{table}
\begin{table}[htbp]\centering \caption{Descriptive statistics for China, 1982-2008 \label{sumstat}}
\begin{tabular}{l c c c c c}\hline\hline
\multicolumn{1}{c}{\textbf{Variables}} & \textbf{Mean}
 & \textbf{(Std. Dev.)}& \textbf{Minimum} &  \textbf{Maximum} & \textbf{N}\\ \hline
Physical Integrity Rights Index & 1.926 & (1.238) & 0 & 4 & 27\\
Physical Integrity Rights Index (Dummy) & 0.148 & (0.362) &
0 & 1 & 27\\
GDP in current USD (\emph{log}) & 27.317 & (0.906) & 26.037 & 29.142 & 27\\
Total population (\emph{log}) & 20.893 & (0.086) & 20.732 & 21.004 & 27\\
\hline
\end{tabular}
\end{table}
\subsection{Pre-analysis of Data}
In order to verify that my data provides reasonable
Hey puts the three tables on a seperate page between the text.

Code: Select all

\section*{Appendix}
\renewcommand{\thesubsection}{A.\arabic{subsection}}
\subsection{Figure 4}
\begin{figure}[htp]
 \centering
        \includegraphics[width=0.75\textwidth]{pics/Figure4.JPG}
        \caption{Kernel density estimation of the Physical Integrity Rights Index for the wealthiest five percent in 2008}
\end{figure}



\subsection{Figure 5}
\begin{figure}[htp]
 \centering
        \includegraphics[width=0.75\textwidth]{pics/Figure5.JPG}
        \caption{Marginal effect of the Chinese human rights level, Table 8, column (3)}
\end{figure}




\subsection{Figure 6}
here, figure 4 is fine. That means between Subsection(Figure 4) and subsection (Figure 5). However, figure 5 is on the ende of the appendix, after the last subsection.

Thank YOu!!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Kit
Posts: 4
Joined: Mon Nov 15, 2010 6:34 pm

Two questions conserning Tables and Figures

Post by Kit »

Hi Nardo,
I'm not exactly sure what your two questions are, but you are using [htbp] after the table declaration, which means you want the table placed here, or if it doesn't fit here, then at the top of the page, and if it doesn't fit there, then at the bottom of the page, and if that doesn't work, then put it on a page containing only tables. If the table isn't going where you expect it to, it must be because it is too large to fit there.

I am not an expert on floating bodies, so I can't offer much help beyond that, but I do know that you can use ! to try to force it to go where you want it to. Also, I know that trying to force figure placement can jam up the whole process, but you might try [!htb]. The Not So Short Introduction to LaTeX 2e has a pretty good summary of floating bodies that might be useful, and maybe someone else in the forum can help further if you need more assistance.
torbjorn t.
Posts: 162
Joined: Wed Jun 17, 2009 10:18 pm

Two questions conserning Tables and Figures

Post by torbjorn t. »

It would be better to provide a complete, compilable, example, instead of three seprate parts of code, and perhaps state the problem more clearly.

Generally floats will end up where they fit best (as LaTeX sees it), and not necessarily where they are in the code. However, if you just want the floats to end up exactly where they are in the code, use H as a float parameter (this requires the float package, which you've loaded already). That is,

Code: Select all

\begin{table}[H]
Post Reply