Latex code for adding sub-figures


This was a heck of a task for me so I saved it here for future use.

Adding four images as subfigures


\begin{figure*}

\begin{subfigure}{0.24\textwidth}
\includegraphics[width=\linewidth]{Figures/Evaluation/xxxx.png}
\caption{}
\end{subfigure}
\hspace{\fill}  % for some horizotal separation
\begin{subfigure}{0.24\textwidth}
\includegraphics[width=\linewidth]{Figures/Evaluation/xxxx.png}
\caption{}
\end{subfigure}
\hspace{\fill}  % for some horizotal separation
\begin{subfigure}{0.24\textwidth}
\includegraphics[width=\linewidth]{Figures/Evaluation/xxxx.png}
\caption{}
\end{subfigure}
\hspace{\fill}  % for some horizotal separation
\begin{subfigure}{0.24\textwidth}
\includegraphics[width=\linewidth]{Figures/Evaluation/xxxx.png}
\caption{}
\end{subfigure}
\vspace{-0.15cm}
\caption{xxxx.}
\vspace{-0.3cm}
\label{Fig:timeDelay}
\end{figure*}
Adding 12 images as sub images



\begin{figure*}[htb]
\centering % <-- added
\begin{subfigure}{0.245\textwidth}
\includegraphics[width=\linewidth]{Figures/Evaluation/xxxx.png}
\caption{image1}
\label{fig:1}
\end{subfigure}\hfil % <-- added
\begin{subfigure}{0.245\textwidth}
\includegraphics[width=\linewidth]{Figures/Evaluation/xxxx.png}
\caption{image2}
\label{fig:2}
\end{subfigure}\hfil % <-- added
\begin{subfigure}{0.245\textwidth}
\includegraphics[width=\linewidth]{Figures/Evaluation/xxxx.png}
\caption{image3}
\label{fig:3}
\end{subfigure}
\begin{subfigure}{0.245\textwidth}
\includegraphics[width=\linewidth]{Figures/Evaluation/xxxx.png}
\caption{image3}
\label{fig:3}
\end{subfigure}
\medskip
\begin{subfigure}{0.245\textwidth}
\includegraphics[width=\linewidth]{Figures/Evaluation/xxxx.png}
\caption{image4}
\label{fig:4}
\end{subfigure}\hfil % <-- added
\begin{subfigure}{0.245\textwidth}
\includegraphics[width=\linewidth]{Figures/Evaluation/xxxx.png}
\caption{image5}
\label{fig:5}
\end{subfigure}\hfil % <-- added
\begin{subfigure}{0.245\textwidth}
\includegraphics[width=\linewidth]{Figures/Evaluation/xxxx.png}
\caption{image6}
\label{fig:6}
\end{subfigure}
\begin{subfigure}{0.245\textwidth}
\includegraphics[width=\linewidth]{Figures/Evaluation/xxxx.png}
\caption{image3}
\label{fig:3}
\end{subfigure}
\medskip
\begin{subfigure}{0.245\textwidth}
\includegraphics[width=\linewidth]{Figures/Evaluation/xxxx.png}
\caption{image4}
\label{fig:4}
\end{subfigure}\hfil % <-- added
\begin{subfigure}{0.245\textwidth}
\includegraphics[width=\linewidth]{Figures/Evaluation/xxxx.png}
\caption{image5}
\label{fig:5}
\end{subfigure}\hfil % <-- added
\begin{subfigure}{0.245\textwidth}
\includegraphics[width=\linewidth]{Figures/Evaluation/xxxx.png}
\caption{image6}
\label{fig:6}
\end{subfigure}
\begin{subfigure}{0.245\textwidth}
\includegraphics[width=\linewidth]{Figures/Evaluation/xxxx.png}
\caption{image3}
\label{fig:3}
\end{subfigure}
\caption{Fasi del processo di impregnazione}
\label{fig:images}
\end{figure*}

Comments

Popular posts from this blog

Guidelines for Effective Academic Writing

Unstructued Notes on TCP IP Networking

Protecting IT Infrastructure: Key Takeaways from the CrowdStrike Update Incident