Writing a paper
Figures and images
Insert images with graphicx, size them to the column, add captions and refer to them.
Open as a project 5 min read
A figure with a caption
Load graphicx and put the image in a figure environment. Always give it a width — width=\linewidth fits the column (or the page in figure*). Without a width the image is placed at its natural size and can run over the text; CiteTeX warns you when that happens.
\begin{figure}[t]
\centering
\includegraphics[width=\linewidth]{figures/results.png}
\caption{Accuracy on the test set.}
\label{fig:results}
\end{figure}
As Figure~\ref{fig:results} shows, …Where the figure goes
Figures float: LaTeX places them where they fit best. The option [t] asks for the top of a page, [h] for "here", [b] for the bottom. Refer to figures by their label instead of writing "the figure below".
Side by side
With subcaption, two images can share one figure, each with its own sub-caption.
\begin{figure}[t]
\centering
\begin{subfigure}{0.48\linewidth}
\includegraphics[width=\linewidth]{figures/a.png}
\caption{Before}
\end{subfigure}\hfill
\begin{subfigure}{0.48\linewidth}
\includegraphics[width=\linewidth]{figures/b.png}
\caption{After}
\end{subfigure}
\caption{Denoising result.}
\end{figure}Try it: the full example compiles as it is. Open as a project