-->
Showing posts with label latex. Show all posts
Showing posts with label latex. Show all posts

Thursday, April 18, 2013

table and figure together




\documentclass{article}

\usepackage{floatrow}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%MARGINS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[a4paper,left=2.5cm, right=2.5cm, top=2.5cm, bottom=4.5cm]{geometry}

\usepackage[latin1]{inputenc}
\usepackage[pdftex]{graphicx}

% \usepackage{wrapfig}


\begin{document}


\begin{figure}[!h]\small
 
  \begin{floatrow}
    \floatbox[]{table}[0.9\FBwidth][40mm][c]{

      \begin{tabular}{ @{\extracolsep{-3pt}} l|ccc|c}
        & \multicolumn{3}{c}{nDCG(k)} & \\
        \hline
        \textsc{Method} & k=10 & k=20 & k=50 & mAP-1 \\
        \hline
        Classification & 0.230 & 0.227 & 0.224 & 5.810\\
        \textbf{JRM} & 0.234 & 0.228 & 0.217 & 5.602 \\
        \textbf{JRM}: rebalanced & \textbf{0.253} & \textbf{0.244} & \textbf{0.227} & \textbf{6.980} \\
      \end{tabular}

}
{
  \caption{Results with and without data rebalancing. For the mAP-{i} results, the top i results are considered relevant.}
  \label{tab:rebalancing}
}
\hspace{0mm}

\ffigbox[1.1\FBwidth]{
  \includegraphics[width=0.3\textwidth]{Nature_reldist.pdf}
}
{\caption{Distribution of relevance levels for the ``Nature'' category.}
  \label{fig:nature_data}}
\end{floatrow}
\end{figure}

\end{document}

Wednesday, October 24, 2012

latex pills





# nice pie-chart in tikz

use http://code.google.com/p/pgf-pie/
                                                                                                                                
\usepackage{pgf-pie}                                                                                                            
\usetikzlibrary{shadows}                                                                                                        
                             

\begin{tikzpicture}                                                                                                   
            \pie{25/Semantic,17/Theme,16/Concept,15/Technique,11/Other,6/Free,4/Emotion,3/Colors,3/Patterns}                    

\end{tikzpicture}                                                                                                  
   




# multiple figures 

\begin{figure}[c]
  \centering
\renewcommand{\thesubfigure}{\arabic{subfigure}}
\subfigure[]{\includegraphics[width=\linewidth]{mosaic_too_dark.jpg}}
\subfigure[]{\includegraphics[width=\linewidth]{mosaic_too_blurry.jpg}}
\subfigure[]{\includegraphics[width=\linewidth]{mosaic_not_seeing.jpg}}
\label{fig:neg_attributes}
\caption{(a) images associated with label}
\end{figure}

use \renewcommand if you want 1 2 3 instead of (a) (b) (c)


# figure and text in the same table:

\usepackage{array}


\newcolumntype{x}[1]{%
>{\raggedleft\hspace{0pt}}p{#1}}%

The argument is the width of the column.
Now simply use “x{2cm}” instead of “p{2cm}”, for columns which align text on the right. By changing \raggedleft to \centering, you can align text in the centre.

Example:

\begin{table}\centering
\begin{tabular}{|l|x{4.5cm}|x{4.5cm}|}\hline
Nb. & Advantage & Disadvantage\tabularnewline\hline
1 & a & b \tabularnewline\hline
2 & b & a \tabularnewline\hline
\end{tabular}
\end{table}



More info in here