1

I have three plots which I want to display one after the other. It displays fine but the only problem I have is the captions are not centered. the subcaptions are more obvious after rendering the picture below.

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{subcaption}

\begin{document}
\begin{figure*}

   \hspace*{-1.1in}
    \begin{subfigure}[b]{\textwidth}
        \centering
        \includegraphics[scale=0.37]{dummy.jpg}
        \caption{\small a image }    
        \label{fig:subfigure1}
    \end{subfigure}
    \vskip\baselineskip
    \hspace*{-1.1in}
    \begin{subfigure}[b]{\textwidth}  
        \centering 
        \includegraphics[scale=0.37]{dummy.jpg}
        \caption[]%
        {{\small b image}}    
        \label{fig:subfigure2}
    \end{subfigure}
    \vskip\baselineskip
    \hspace*{-1.1in}
    \begin{subfigure}[b]{\textwidth}   
        \centering 
        \includegraphics[scale=0.37]{dummy.jpg}
        \caption[]%
        {{\small c image}}    
        \label{fig:subfigure3}
    \end{subfigure}

    \caption[ whole image caption here]
    {\small whole image caption here} 
    \label{fig:experiments}
\end{figure*}

\end{document}

I am adding the image because it is extra wide, it is what I am using as a test

dummy.jpg

https://i.stack.imgur.com/5wjJ6.jpg

  • 2
    You probably want something like width=\linewidth rather than scale. If you want to increase the text block width temporarily, use something like changepage. And then look at the configuration options for configuring sub-captions and captions e.g. font size, alignment etc. – cfr Jun 19 '18 at 1:39
1

As @cfr has already pointed out in a comment, you should replace the three [scale=0.37] options with [width=\textwidth]. Omit the three redundant \centering instructions and replace both instances of \vskip\baselineskip\hspace*{-1.1in} with \vspace{1\baselineskip}. Finally, run the instruction \captionsetup{font=small} to save yourself from having to insert \small in the body of each and every \caption instruction.

enter image description here

\documentclass[demo]{article} % omit 'demo' option in real document

\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{subcaption}

\begin{document}
\begin{figure*}
\captionsetup{font=small} % font size for caption and subcaptions
    \begin{subfigure}[b]{\textwidth}
        \includegraphics[width=\textwidth]{dummy.jpg}
        \caption{a image }    
        \label{fig:subfigure1}
    \end{subfigure}

    \medskip
    \begin{subfigure}[b]{\textwidth}  
        \includegraphics[width=\textwidth]{dummy.jpg}
        \caption{b image}  
        \label{fig:subfigure2}
    \end{subfigure}

    \medskip
    \begin{subfigure}[b]{\textwidth}   
        \includegraphics[width=\textwidth]{dummy.jpg}
        \caption{c image}
        \label{fig:subfigure3}
    \end{subfigure}

    \caption[whole image caption here]{whole image caption here} 
    \label{fig:experiments}
\end{figure*}

\end{document}
  • thank you for the answer. The plots are nicely arranged and with centered captions now but I would like to be able to stretch the image so as to spill in the margins on both sides. Making it larger than width=\textwidth and start it from somewhere in the left margin space . This is why I thought \hspace*{-1.1in} would work, but seems to be dragging the captions with it. – zaranaid Jun 19 '18 at 19:09

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.