I am trying to plot two figures side by side and I simply can't find why my Output is stacking them on top of each other and not side by side. Any help would be greatly appreciated.
\documentclass[preprint,12pt]{elsarticle}
\usepackage{subcaption}
\usepackage{graphicx,caption}
\begin{figure}[t!]
\centering
\begin{subfigure}[b]{\linewidth}
\centering
\includegraphics[width=0.4\linewidth]{figures/coupling term graph}
\captionsetup{width=0.4\linewidth}
\caption{Plot of theoretical coupling term using the magnet and coil parameters given in table 1}
\end{subfigure}
\begin{subfigure}[b]{\linewidth}
\centering
\includegraphics[width=0.4\linewidth]{figures/coupling term superposition}
\captionsetup{width=0.4\linewidth}
\caption{Plot of theoretical coupling term using two identical magnets placed at each position for maximum flux for the coil parameters given in table 1}
\end{subfigure}
\end{figure}
\end{document}
\documentclass
ending with a\end{document}
. It will allow us to reproduce the behavior.