0

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]
 \centering % <-- added
 \begin{subfigure}{0.30\textwidth}
 \includegraphics[width=\linewidth]{1}
 \caption{IEMG}
 \label{fig:1}
 \end{subfigure}\hfil % <-- added
 \begin{subfigure}{0.30\textwidth}
 \includegraphics[width=\linewidth]{2}
 \caption{MAV}
 \label{fig:2}
 \end{subfigure}\hfil % <-- added
 \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}
 \end{subfigure}\hfil % <-- added
 \begin{subfigure}{0.30\textwidth}
 \includegraphics[width=\linewidth]{5}
 \caption{RMS}
 \label{fig:5}
 \end{subfigure}\hfil % <-- added
 \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}
 \end{subfigure}\hfil % <-- added
 \begin{subfigure}{0.30\textwidth}
 \includegraphics[width=\linewidth]{8}
 \caption{DASDV}
 \label{fig:8}
 \end{subfigure}\hfil % <-- added
 \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.

6
  • 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.
    – Zarko
    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.
    – Debbie
    Mar 8 at 16:48
  • It seems that your question is duplicate to your previous question. Or I do overlook something?
    – Zarko
    Mar 8 at 17:08
  • Previous Q was about tables in IEEEtran format, this one related to figures.
    – Debbie
    Mar 8 at 17:14
  • 1
    There is no diference between tables and figures :-), I will try to write an answer ASAP.
    – Zarko
    Mar 8 at 18:39
2

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}

enter image description here

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

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.