I'm trying to put 3 images into one figure on one line. I have done the following approach:
\documentclass[sigconf]{acmart}
\usepackage{subcaption}
\begin{document}
\begin{figure*}
\begin{subfigure}{0.33\textwidth}
\includegraphics[width=0.33\textwidth]{1}
\caption{}
\label{fig:3_classes}
\end{subfigure}
\begin{subfigure}{0.33\textwidth}
\includegraphics[width=0.33\textwidth]{1}
\caption{}
\label{fig:5_classes}
\end{subfigure}
\begin{subfigure}{0.33\textwidth}
\includegraphics[width=0.33\textwidth]{1}
\caption{}
\label{fig:6_classes}
\end{subfigure}\par\medskip
\caption{This is a test.}
\end{figure*}
\end{document}
The image 1.png is available on onedrive: https://1drv.ms/u/s!AlkQuYgB1McYg8xUxUYxiZlhf9b6Ww
The problem is that I'm getting the following results. The captions are ok but the images are really small and somehow left alligned. I would like to have the images as large as possible so that they fit on one line.
Is this possible?
Best Answer
It's often better to use
\linewidth
to measure the width of the current "block" rather than\textwidth
. While you think\textwidth
refers to the entire width of the text block and therefore0.33\textwidth
should refer to (roughly) 1/3 of the text block, it doesn't. Under thesubfigure
environment,\textwidth
is updated (actually setting it's contents inside aminipage
which updates\textwidth
) and doesn't represent what it stands for originally. You're effectively looking at an image that has a width of 0.33 x 0.33 x\textwidth
or about 1/10 of the text width.