# How can I place multiple figures in multiple rows and columns in IEEEtran format?

I wrote a code to place multiple figures in multiple rows and columns:

 \usepackage{booktabs}
\usepackage{float}
\usepackage{multirow}
\usepackage{makecell}
\usepackage{caption,subcaption}
%\usepackage[caption=false,font=footnotesize]{subfig}
\usepackage{varwidth}
\graphicspath{ {./images/} }
\usepackage{nccmath}
\usepackage{afterpage}
\usepackage{placeins}
\hyphenation{op-tical net-works semi-conduc-tor}
\bibliographystyle{ieeetr}

\begin{document}

\begin{figure*}[htb]
\begin{subfigure}{0.30\textwidth}
\includegraphics[width=\linewidth]{1}
\caption{IEMG}
\label{fig:1}
\begin{subfigure}{0.30\textwidth}
\includegraphics[width=\linewidth]{2}
\caption{MAV}
\label{fig:2}
\begin{subfigure}{0.30\textwidth}
\includegraphics[width=\linewidth]{3}
\caption{MAV1}
\label{fig:3}
\end{subfigure}

\medskip
\begin{subfigure}{0.30\textwidth}
\includegraphics[width=\linewidth]{4}
\caption{Variance}
\label{fig:4}
\begin{subfigure}{0.30\textwidth}
\includegraphics[width=\linewidth]{5}
\caption{RMS}
\label{fig:5}
\begin{subfigure}{0.30\textwidth}
\includegraphics[width=\linewidth]{6}
\caption{WL}
\label{fig:6}
\end{subfigure}

\medskip
\begin{subfigure}{0.30\textwidth}
\includegraphics[width=\linewidth]{7}
\caption{AAC}
\label{fig:7}
\begin{subfigure}{0.30\textwidth}
\includegraphics[width=\linewidth]{8}
\caption{DASDV}
\label{fig:8}
\caption[Scatter plots for different features for data from first two sensors for 8 categories]
{\begin{varwidth}[t]{\linewidth}Scatter plots for different features for data
from first two \\sensors for 8 categories of  hand gestures\end{varwidth}}
\label{fig:images}
\end{figure*}

\end{document}


It was working until I replaced \usepackage{caption,subcaption} with \usepackage[caption=false,font=footnotesize]{subfig} to make my table captions conform to IEEEtran format.

• Are you aware that caption and subcaption overwrite IEEEtran settings? See tex.stackexchange.com/questions/586308/…, you may extend second example in answer to your number of subfloats. Mar 8 at 16:34
• Yeah today I came to know that caption and subcaption overwrite IEEEtran settings but as a beginner I'm facing difficulties to modify my code to conform to IEEEtran settings. Mar 8 at 16:48
• It seems that your question is duplicate to your previous question. Or I do overlook something? Mar 8 at 17:08
• Previous Q was about tables in IEEEtran format, this one related to figures. Mar 8 at 17:14
• There is no diference between tables and figures :-), I will try to write an answer ASAP. Mar 8 at 18:39

Essentially this your question is duplicate to your previous one. \subfloat is just a container in which is element of main float. In the case of table, in it is inserted table, if it is figure, in it is inserted figures.

Considering instruction for IEEEtran package How to Use the IEEEtran LATEX Class (written by package author and maintainer, section X), your MWE should be:

\documentclass[journal]{IEEEtran}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage[caption=false,font=footnotesize]{subfig}

\begin{document}
\begin{figure*}
\centering
\setkeys{Gin}{width=0.3\linewidth}
\subfloat[IEMG]{\includegraphics{example-image-duck}}% 1
\hfill
\subfloat[MAV]{\includegraphics{example-image-duck}}% 2
\hfill
\subfloat[MAV1]{\includegraphics{example-image-duck}}% 3

\subfloat[Variance]{\includegraphics{example-image-duck}}% 4
\hfill
\subfloat[RMS]{\includegraphics{example-image-duck}}% 5
\hfill
\subfloat[WL]{\includegraphics{example-image-duck}}% 6

\subfloat[AAC]{\includegraphics{example-image-duck}}% 7
\hfil
\subfloat[DASDV]{\includegraphics{example-image-duck}}% 8

\caption{Scatter plots for different features for data from first two  sensors for 8 categories of  hand gestures.}
\label{fig:images}
\end{figure*}
\end{document}


• Hi thanks. Just a little doubt - should fig main caption be in italics in IEEEtran format ? Mar 8 at 19:56