1

This question already has an answer here:

\usepackage{graphicx}

\usepackage{subcaption}



\begin{figure}[h!]

\centering

  \begin{subfigure}[b]{.3\textwidth}    
        \includegraphics[width=\textwidth]{nano1_Images/eclipsed_iron.png}
        \caption{Eclipsed Cobalt}
        \label{img1}
        \end{subfigure}


    \begin{subfigure}[b]{.3\textwidth}  
        \includegraphics[width=\textwidth]{nano1_Images/staggered_iron.png}
        \caption{Eclipsed Cobalt}
        \label{img2}
        \end{subfigure}

    \begin{subfigure}[b]{.3\textwidth}  
        \includegraphics[width=\textwidth]{nano1_Images/eclipsed_cobalt.png}
        \caption{Eclipsed Cobalt}
        \label{img3}
    \end{subfigure} 


    \caption{DMol3, atom colors}
\end{figure}

marked as duplicate by Mico, Community Mar 26 at 20:23

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Welcome to TeX.SE. – Mico Mar 26 at 20:01
1

If you want subfigures in one row you shouldn't break lines after them. For better readability you can comment the breaklines.

\end{subfigure}% 
\begin{subfigure}

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