4

I am writing a paper that has a template which runs text down two columns. I have a 2x3 (2 wide, 3 tall) grid of images that currently are contained in one column. I'd like to make it a 3x2 grid that spans across both column while also making the images bigger.

My current code is:

\begin{figure}[ht]
\centering
\subfigure[Total/Avg]{
  \label{fig:Total_scatter}
  \includegraphics[width=0.49\columnwidth]{images/Total_scatter}
}%
\subfigure[Num/Avg]{
  \label{fig:Num_scatter}
  \includegraphics[width=0.49\columnwidth]{images/Num_scatter}
}
\subfigure[Raw/Avg]{
  \label{fig:Raw_scatter}
  \includegraphics[width=0.49\columnwidth]{images/Raw_scatter}
}%
\subfigure[Num/Raw]{
  \label{fig:Num_Raw_scatter}
  \includegraphics[width=0.49\columnwidth]{images/Num_Raw_scatter}
}
\subfigure[Total/Raw]{
  \label{fig:Total_Raw_scatter}
  \includegraphics[width=0.49\columnwidth]{images/Total_Raw_scatter}
}%
\subfigure[Num/Total]{
  \label{fig:Num_Total_scatter}
  \includegraphics[width=0.49\columnwidth]{images/Num_Total_scatter}
}%
\caption{Scatter plots of 6 pics.}%
\label{fig:Scatter}
\end{figure}

I'm unsure where the size of the image is, or is it put to scale to conform to the space given (and thus dynamically change as space is available/

Any help would be greatly appreciated.

EDIT

The below two answers got me almost there, except that the text I have in the neighboring column is not wrapping around the expanded figures now. And I apologize for not listing the class file - I'm new to Tex and taking over a document. I'm using the sig-alternate.cls file found here: acm.org/sigs/publications/proceedings-templates

1
  • Your sentence beginning "I'm unsure where ..." is kind of unclear. The normal situation is that the image will be scaled [width=0.49\columnwidth], so if that is shrinking the width of the original image, the height will be proportionately scaled the same amount; of, if it is stretching the image some, the height will also be stretched. You can force dimensions, if you like, by specifying width and height. For images that span two columns, you probably need some extra package help --- but it would be helpful if you provided a complete example file: \documentclass to \end{document}. – jon Oct 7 '13 at 4:25
4
+50

You mention working with a two-column setup, and that whereas you currently have the entire figure environment take up the width of one column, you'd really like to have it occupy the width of the entire text block, i.e., both columns. For that, you need to switch to the figure* environment. A starred float environment always has to show up at the top of a page; hence, omit the [ht] location specifier.

Furthermore, because you want three subfigures per (now much wider) row, you should switch the width of each subfigure from 0.49\columnwidth to something like 0.31\textwidth. And, use \hspace*{\fill} to push the subfigures out to the margins, i.e., to make them take up the entire textblock. Finally, use comment symbols (%) at various line ends within each subfigure to avoid introducing spurious spaces.

The following image shows the effect of implementing these suggestions:

enter image description here

\documentclass[twocolumn]{article}
\usepackage[demo]{graphicx} % omit 'demo' option in real document
\usepackage{subfigure}
\usepackage{lipsum} % for filler text
\begin{document}
\lipsum[1-3] % start with some filler text

\begin{figure*}%
%% first three subfigures
\subfigure[Total/Avg]{%
  \label{fig:Total_scatter}%
  \includegraphics[width=0.31\textwidth]{images/Total_scatter}%
}%
\hspace*{\fill}
\subfigure[Num/Avg]{
  \label{fig:Num_scatter}%
  \includegraphics[width=0.31\textwidth]{images/Num_scatter}%
}%
\hspace*{\fill}
\subfigure[Raw/Avg]{
  \label{fig:Raw_scatter}%
  \includegraphics[width=0.31\textwidth]{images/Raw_scatter}%
}

%% second group of subfigures
\subfigure[Num/Raw]{%
  \label{fig:Num_Raw_scatter}%
  \includegraphics[width=0.31\textwidth]{images/Num_Raw_scatter}%
}%
\hspace*{\fill}
\subfigure[Total/Raw]{
  \label{fig:Total_Raw_scatter}%
  \includegraphics[width=0.31\textwidth]{images/Total_Raw_scatter}%
}%
\hspace*{\fill}
\subfigure[Num/Total]{
  \label{fig:Num_Total_scatter}%
  \includegraphics[width=0.31\textwidth]{images/Num_Total_scatter}%
}
\caption{Scatter plots of 6 pics.}\label{fig:Scatter}
\end{figure*}

\lipsum[4-10] % more filler text
\end{document}
3
  • This worked well except that the text I have in the neighboring column is not wrapping around the expanded figures now. And I apologize for not listing the class file - I'm new to Tex and taking over a document. I'm using the sig-alternate.cls file found here: acm.org/sigs/publications/proceedings-templates – ngramsky Oct 10 '13 at 20:19
  • Although I should caveat that I did not use the lipsum item, though I think it is not warranted? I could not get it to work if it needs to be used, though I'm not sure what that is doing in this example. – ngramsky Oct 10 '13 at 20:29
  • @ngramsky - the lipsum package is needed only for filler text. In particular, enough filler text was needed in the MWE to push the figure* environment to the next page, with enough text to spare so as to let it (the text) show up below the material. In your real document, you should naturally not use \lipsum... – Mico Oct 10 '13 at 20:48
2

You've got a lot of whitespace creeping in at the ends of your lines. Cleaning up the whitespace by adding % to the end of lines will help a bit. Also, it would make your customizations easier if you use a new length to control the width of your images:

\documentclass{article}
\usepackage{graphicx}
\usepackage{subfigure}
\pagestyle{empty}
\newlength{\myimagewidth}
\begin{document}
\setlength{\myimagewidth}{\dimexpr\columnwidth/3-1em\relax}

\begin{figure}[ht]
\centering
\subfigure[Total/Avg]{%
  \label{fig:Total_scatter}%
  \includegraphics[width=\myimagewidth]{example-image-a}%
}
\subfigure[Num/Avg]{%
  \label{fig:Num_scatter}%
  \includegraphics[width=\myimagewidth]{example-image-b}%
}
\subfigure[Raw/Avg]{%
  \label{fig:Raw_scatter}%
  \includegraphics[width=\myimagewidth]{example-image-c}%
}
\subfigure[Num/Raw]{%
  \label{fig:Num_Raw_scatter}%
  \includegraphics[width=\myimagewidth]{example-image-a}%
}
\subfigure[Total/Raw]{%
  \label{fig:Total_Raw_scatter}%
  \includegraphics[width=\myimagewidth]{example-image-b}%
}
\subfigure[Num/Total]{%
  \label{fig:Num_Total_scatter}%
  \includegraphics[width=\myimagewidth]{example-image-c}%
}
\caption{Scatter plots of 6 pics.}%
\label{fig:Scatter}
\end{figure}
\end{document}

enter image description here

Closing note

It's much more helpful if you include a working MWE or at least a MWE which includes all the packages to duplicate your issue. Generally having us guess what packages you may or may not be using may result in answers which don't quite tackle the issue as you need it tackled.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.