2

I wrote this latex but it does not look exactly as I want it. It is a two column article so the graphs should be two columns and the charts should flow through the two columns with two charts side by side in the column, but this takes up the whole page and then the caption spans the whole page, instead of just the column. Please help me make this look good in the context of a two column article. Any suggestions are welcome. thanks.

-Rik

enter image description here

%File: formatting-instruction.tex
\documentclass[letterpaper]{article}
\usepackage{aaai}
\usepackage{mathptmx} % Times Roman for text *and* math
\usepackage{times}
\usepackage{helvet}
\usepackage{courier}
\usepackage{graphicx}
\usepackage{array}
\usepackage{booktabs,tabularx}
\usepackage{caption}
\usepackage{subcaption}
\newcolumntype{L}{>{\centering\arraybackslash}m{3cm}}
    \newcolumntype{C}{>{\centering\arraybackslash}X}
\graphicspath{ {images/} }
\frenchspacing
\setlength{\pdfpagewidth}{8.5in}
\setlength{\pdfpageheight}{11in}
\pdfinfo{
/Title (Insert Your Title Here)
/Author (Put All Your Authors Here, Separated by Commas)}
\setcounter{secnumdepth}{0}  
 \begin{document}
\begin{figure*}
\centering
\begin{minipage}[b]{.45\columnwidth}
\includegraphics[width=\columnwidth]{Data1}
\caption{Day1: 02-Nov-2014: Adverse Event Count = 106 (time duration 08:50) Max Excursion= 3.96° DF}\label{label-a}
\end{minipage}\qquad
\begin{minipage}[b]{.45\columnwidth}
\includegraphics[width=\columnwidth]{Data14}
\caption{Day14: 15-Nov-2014: Adverse Event Count = 107 (time duration 08:55) Max Excursion= 1.95° F
}\label{label-b}
\end{minipage}\qquad
\begin{minipage}[b]{.45\columnwidth}
\includegraphics[width=\columnwidth]{Data15}
\caption{Day15: 16-Nov-2014: Adverse Event Count = 103 (time duration 08:35) Max Excursion= 3.96° F
}\label{label-a}
\end{minipage}\qquad
\begin{minipage}[b]{.45\columnwidth}
\includegraphics[width=\columnwidth]{Data16}
\caption{Day16: 17-Nov-2014: Adverse Event Count = 7 (time duration 00:35) Max Excursion= 0.94° F
}\label{label-b}
\end{minipage}\qquad
\begin{minipage}[b]{.45\columnwidth}
\includegraphics[width=\columnwidth]{Data19}
\caption{Day19: 20-Nov-2014: Adverse Event Count = 8 (time duration 00:40) Max Excursion= 0.94° F
}\label{label-a}
\end{minipage}\qquad
\begin{minipage}[b]{.45\columnwidth}
\includegraphics[width=\columnwidth]{Data22}
\caption{Day22: 22-Nov-2014: Adverse Event Count = 75 (time duration 06:15) Max Excursion= 0.94° F
}\label{label-b}
\end{minipage}\qquad
\begin{minipage}[b]{.45\columnwidth}
\includegraphics[width=\columnwidth]{Data23}
\caption{Day23: 23-Nov-2014: Adverse Event Count = 114 (time duration 09:30) Max Excursion= 4.98° F
}\label{label-a}
\end{minipage}\qquad
\begin{minipage}[b]{.45\columnwidth}
\includegraphics[width=\columnwidth]{Data24}
\caption{Day24: 24-Nov-2014: Adverse Event Count = 8 (time duration 00:40) Max Excursion= 0.94° F
}\label{label-b}
\end{minipage}\qquad
\begin{minipage}[b]{.45\columnwidth}
\includegraphics[width=\columnwidth]{Data25}
\caption{Day25: 25-Nov-2014: Adverse Event Count = 12 (time duration 01:00) Max Excursion= 1.04° F}\label{label-a}
\end{minipage}\qquad
\begin{minipage}[b]{.45\columnwidth}
\includegraphics[width=\columnwidth]{Data26}
\caption{Day26: 27-Nov-2014: Adverse Event Count = 8 (time duration 00:40) Max Excursion= 0.94° F}\label{label-b}
\end{minipage}\qquad
\begin{minipage}[b]{.45\columnwidth}
\includegraphics[width=\columnwidth]{Data61}
\caption{Day61: 01-Jan-2015: Adverse Event Count = 19 (time duration 01:35) Max Excursion= 0.57° F}\label{label-a}
\end{minipage}\qquad
\begin{minipage}[b]{.45\columnwidth}
\includegraphics[width=\columnwidth]{Data73}
\caption{Day73: 13-Jan-2015: Adverse Event Count = 23 (time duration 01:55) Max Excursion= 0.80° F
}\label{label-b}
\end{minipage}\qquad
\caption*{Figure 9-20: Adverse Area Plots (Quantity Below 68.1 Degrees F) for all days containing adverse events. As per ACCEPT Adverse Event Paradigm, these events are only in testing/validation data-sets}
\end{figure*}

\end{document}
Rik
  • 85
  • If you want two charts to fit within a column, use 2 or more figures instead of one big figure*, and you will probably have to adjust some parameter (see http://tex.stackexchange.com/questions/39017/how-to-influence-the-position-of-float-environments-like-figure-and-table-in-lat/39020?s=1|0.0000#39020). Alternatively, use \hfill or possibly \hspace{\columnsep} for spacing. – John Kormylo Apr 25 '16 at 23:47
  • If you want a main caption consider use the on starred version and the subcaption or subfigure packages . – Fran Apr 26 '16 at 06:00
  • 1
    If you want a figure of that size, it really probably wants to be on its own page else you'll have a little tiny bit of text which will look a bit daft. It isn't clear why you want the caption to span only one column given that the charts run left to right and then down, which wouldn't work if you have 2 groupings with one group per column. Then you'd have something like 1->2->7->8; 3->4->9->10; 5->-6->11->12 with, say, a caption for 1-6 and one for 7-12. But that's not the order you've configured. – cfr Apr 29 '16 at 02:21
  • Do you want these to just be part of the main text i.e. not to 'float' as figures always do? If the group floats, it is going to take a page unless you do something drastic, which won't look good. – cfr May 02 '16 at 21:09

1 Answers1

2

See, if the following solution is close to ones you looking for:

enter image description here

To your MWE I add showframe (for see page layout, in real use it should be omitted), options font=small and justification=RaggedRight to package caption (with this the height of images is slightly reduced) and usetwo image environment for hack to obtain desired form of page. Package lipsum is for dummy text.

\documentclass[letterpaper,twocolumn]{article}
\usepackage{mathptmx} % Times Roman for text *and* math
\usepackage{times}
\usepackage{helvet}
\usepackage{courier}
\usepackage{graphicx}
\usepackage[font=small,justification=RaggedRight]{caption}% <-- added options
\frenchspacing
\setlength{\pdfpagewidth}{8.5in}
\setlength{\pdfpageheight}{11in}

\usepackage{ragged2e}% <-- new

\usepackage{lipsum}% <-- in real use should be omitted
\usepackage{showframe}% <-- in real use should be omitted

 \begin{document}
\lipsum[1-3]
\begin{figure*}[t!]
\begin{minipage}[b]{.22\linewidth}
\includegraphics[width=\columnwidth]{example-image}
\caption{Day1: 02-Nov-2014: Adverse Event Count = 106 (time duration 08:50) Max Excursion= 3.96° DF}\label{label-a}
\end{minipage}
\hfill
\begin{minipage}[b]{.22\linewidth}
\includegraphics[width=\columnwidth]{example-image}
\caption{Day14: 15-Nov-2014: Adverse Event Count = 107 (time duration 08:55) Max Excursion= 1.95° F
}\label{label-b}
\end{minipage}
\hfill
\begin{minipage}[b]{.22\linewidth}
\includegraphics[width=\columnwidth]{example-image}
\caption{Day15: 16-Nov-2014: Adverse Event Count = 103 (time duration 08:35) Max Excursion= 3.96° F
}\label{label-a}
\end{minipage}
\hfill
\begin{minipage}[b]{.22\linewidth}
\includegraphics[width=\columnwidth]{example-image}
\caption{Day16: 17-Nov-2014: Adverse Event Count = 7 (time duration 00:35) Max Excursion= 0.94° F
}\label{label-b}
\end{minipage}

\begin{minipage}[b]{.22\linewidth}
\includegraphics[width=\columnwidth]{example-image}
\caption{Day19: 20-Nov-2014: Adverse Event Count = 8 (time duration 00:40) Max Excursion= 0.94° F
}\label{label-a}
\end{minipage}
\hfill
\begin{minipage}[b]{.22\linewidth}
\includegraphics[width=\columnwidth]{example-image}
\caption{Day22: 22-Nov-2014: Adverse Event Count = 75 (time duration 06:15) Max Excursion= 0.94° F
}\label{label-b}
\end{minipage}
\hfill
\begin{minipage}[b]{.22\linewidth}
\includegraphics[width=\columnwidth]{example-image}
\caption{Day23: 23-Nov-2014: Adverse Event Count = 114 (time duration 09:30) Max Excursion= 4.98° F
}\label{label-a}
\end{minipage}
\hfill
\begin{minipage}[b]{.22\linewidth}
\includegraphics[width=\columnwidth]{example-image}
\caption{Day24: 24-Nov-2014: Adverse Event Count = 8 (time duration 00:40) Max Excursion= 0.94° F
}\label{label-b}
\end{minipage}

\begin{minipage}[b]{.22\linewidth}
\includegraphics[width=\columnwidth]{example-image}
\caption{Day25: 25-Nov-2014: Adverse Event Count = 12 (time duration 01:00) Max Excursion= 1.04° F}\label{label-a}
\end{minipage}
\hfill
\begin{minipage}[b]{.22\linewidth}
\includegraphics[width=\columnwidth]{example-image}
\caption{Day26: 27-Nov-2014: Adverse Event Count = 8 (time duration 00:40) Max Excursion= 0.94° F}\label{label-b}
\end{minipage}
\hfill
\begin{minipage}[b]{.22\linewidth}
\includegraphics[width=\columnwidth]{example-image}
\caption{Day61: 01-Jan-2015: Adverse Event Count = 19 (time duration 01:35) Max Excursion= 0.57° F}\label{label-a}
\end{minipage}
\hfill
\begin{minipage}[b]{.22\linewidth}
\includegraphics[width=\columnwidth]{example-image}
\caption{Day73: 13-Jan-2015: Adverse Event Count = 23 (time duration 01:55) Max Excursion= 0.80° F
}\label{label-b}
\end{minipage}
    \end{figure*}
    \begin{figure}[h!]
    \vskip1ex
\captionof*{figure}{Figure 9-20: Adverse Area Plots (Quantity Below 68.1 Degrees F) for all days containing adverse events. As per ACCEPT Adverse Event Paradigm, these events are only in testing/validation data-sets}
    \vskip-5ex
    \end{figure}
\lipsum[4-9]
\end{document}

As you can see, the MWE has two manual adjusting of vertical spaces in the second figure environment which serve only for common caption/comment for above figures.

Addendum: Above solution is based on assumption, that all figures should be tied to each other, i.e. without text between them and with common description in one column which follows immediately to them.

An easily looked over figures can be obtained with their organization into 4 x 3 matrix (as indicated in question} over two columns in environment figure* to which follow another one column figure with common explanation/caption. This is possible if the sum of the both figures height is smaller than permitted area for figures on one page. This was reason why in the caption is reduced size of fonts.

Another possibilities is organizing figures into two figure environments, where the second also contain common "caption" (see example below). This solution not guarantee that all images will appear in one page as this is case in above solution.

In second solution instead of minipages is used tabularx (evidently it can be used also in the first solution). First figure has option [t!] and the second [b!]. With this is achieved flow of figures.

    \documentclass[letterpaper,twocolumn]{article}
    \usepackage{mathptmx} % Times Roman for text *and* math
    \usepackage{times,helvet,courier}
    \usepackage{graphicx}
    \usepackage[font=small,justification=RaggedRight]{caption}% <-- added options
    \frenchspacing
    \setlength{\pdfpagewidth}{8.5in}
    \setlength{\pdfpageheight}{11in}

    \usepackage{ragged2e}% <-- new
    \usepackage{tabularx}% <-- new

    \usepackage{lipsum}% <-- in real use should be omitted
    \usepackage{showframe}% <-- in real use should be omitted

     \begin{document}
    \lipsum[1-3]
    \begin{figure}[b!]
    \begin{tabularx}{\columnwidth}{@{}*{2}{X}@{}}
\includegraphics[width=\linewidth]{example-image}
\caption{Day1: 02-Nov-2014: Adverse Event Count = 106 (time duration 08:50) Max Excursion= 3.96° DF}\label{label-a}
    &   \includegraphics[width=\linewidth]{example-image}
        \caption{Day14: 15-Nov-2014: Adverse Event Count = 107 (time duration 08:55) Max Excursion= 1.95° F
        }\label{label-b}
                    \\
\includegraphics[width=\linewidth]{example-image}
\caption{Day15: 16-Nov-2014: Adverse Event Count = 103 (time duration 08:35) Max Excursion= 3.96° F
}\label{label-b}
    &   \includegraphics[width=\linewidth]{example-image}
        \caption{Day16: 17-Nov-2014: Adverse Event Count = 7 (time duration 00:35) Max Excursion= 0.94° F
        }\label{label-c}
                    \\
\includegraphics[width=\linewidth]{example-image}
\caption{Day19: 20-Nov-2014: Adverse Event Count = 8 (time duration 00:40) Max Excursion= 0.94° F
}\label{label-a}
    &   \includegraphics[width=\linewidth]{example-image}
        \caption{Day22: 22-Nov-2014: Adverse Event Count = 75 (time duration 06:15) Max Excursion= 0.94° F
        }\label{label-d}
    \end{tabularx}
    \end{figure}
% second part    
    \begin{figure}[t!]
    \begin{tabularx}{\columnwidth}{@{}*{2}{X}@{}}
\includegraphics[width=\linewidth]{example-image}
\caption{Day23: 23-Nov-2014: Adverse Event Count = 114 (time duration 09:30) Max Excursion= 4.98° F
}\label{label-e}
    &   \includegraphics[width=\linewidth]{example-image}
        \caption{Day24: 24-Nov-2014: Adverse Event Count = 8 (time duration 00:40) Max Excursion= 0.94° F
        }\label{label-f}
                    \\
\includegraphics[width=\linewidth]{example-image}
\caption{Day25: 25-Nov-2014: Adverse Event Count = 12 (time duration 01:00) Max Excursion= 1.04° F}\label{label-g}
    &   \includegraphics[width=\linewidth]{example-image}
        \caption{Day26: 27-Nov-2014: Adverse Event Count = 8 (time duration 00:40) Max Excursion= 0.94° F}\label{label-h}
                    \\
\includegraphics[width=\linewidth]{example-image}
\caption{Day61: 01-Jan-2015: Adverse Event Count = 19 (time duration 01:35) Max Excursion= 0.57° F}\label{label-i}
    &   \includegraphics[width=\linewidth]{example-image}
        \caption{Day73: 13-Jan-2015: Adverse Event Count = 23 (time duration 01:55) Max Excursion= 0.80° F
    }\label{label-j}
    \end{tabularx}\vskip-3ex

\captionof*{figure}{Figure 9-20: Adverse Area Plots (Quantity Below 68.1 Degrees F) for all days containing adverse events. As per ACCEPT Adverse Event Paradigm, these events are only in testing/validation data-sets}
        \end{figure}
    \lipsum[4-9]
    \end{document}

enter image description here

Further improvement of figures look-out can be obtain with introduction of shortens for repeating text, for example AEC for Adverse Event Count, ME for Max Excursion, which meaning can be given in common "caption". Similarly can be replaced mount short names with number (for example 02-Nov-2011 --> 02-11-2014). With these the captions would become more compact and height of figures is reduced.

The code is self-explanatory. In the first solution only slightly differ from MWE in question, in the second solution main difference is in used tabularx, whic simplify code and make it more concise.

Zarko
  • 296,517
  • @Rik, Please see addendum to my answer. It contain short explanation and one more possible solution. If you need some more information, don't hesitate to ask for further clarification. – Zarko May 06 '16 at 05:51