How to horizontally place figures in Latex

How to horizontally place figures in Latex

Approach 1: The first thing you can do is to use the figures, subfigure package

\begin{figures*}

\centering

\begin{subfigure}[h]{0.495\textwidth}

\includegraphics[width=\textwidth]{figures/page_rank.pdf}

\caption{PageRank}

\end{subfigure}

\begin{subfigure}[h]{0.495\textwidth}

\includegraphics[width=\textwidth]{figures/collab_fill.pdf}

\caption{Collaborative Filtering}

\end{subfigure}

\end{figures*}

Note1: The difference between “figure” and “figures*” is that “figures*” allow the figure to span two columns.

Notes2: it is possbile to do

\begin{subfigure}[h]{0.495\textwidth}

\includegraphics[width=\textwidth]{figures/page_rank.pdf}

\caption{PageRank}

\end{subfigure}

\begin{subfigure}[h]{0.495\textwidth}

\includegraphics[width=\textwidth]{figures/collab_fill.pdf}

\caption{Collaborative Filtering}

\end{subfigure}

The % makes sure that the next figure will be aligned horizontally.

 

Approach 2: use an external tool for editing

There is another approach, get the figures in keynote or powerpoint, and make them align anyway you want. Then include graphics in one figure.

Appraoch 3: Another approach is to use mini page

http://tex.stackexchange.com/questions/37581/latex-figures-side-by-side

\documentclass[english]{article}
\usepackage[demo]{graphicx}
\usepackage{babel,blindtext}

\begin{document}

\blindtext

\begin{figure}[!htb]
\minipage{0.32\textwidth}
  \includegraphics[width=\linewidth]{delete_gesture.png}
  \caption{A really Awesome Image}\label{fig:awesome_image1}
\endminipage\hfill
\minipage{0.32\textwidth}
  \includegraphics[width=\linewidth]{ok_gesture.png}
  \caption{A really Awesome Image}\label{fig:awesome_image2}
\endminipage\hfill
\minipage{0.32\textwidth}%
  \includegraphics[width=\linewidth]{settings_gesture.png}
  \caption{A really Awesome Image}\label{fig:awesome_image3}
\endminipage
\end{figure}

\blindtext

\end{document}

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

One Response to How to horizontally place figures in Latex

  1. Pingback: Latex Notes | Yunming Zhang's Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s