如何在 IEEEtran 格式中将多个图形放置在多行和多列中?

如何在 IEEEtran 格式中将多个图形放置在多行和多列中?

我编写了一个代码,将多个图形放置在多行和多列中:

 \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}

它一直正常工作,直到我将其替换\usepackage{caption,subcaption}\usepackage[caption=false,font=footnotesize]{subfig}使我的表格标题符合 IEEEtran 格式。

答案1

本质上,这个问题与上一个问题是重复的。\subfloat只是一个容器,其中是主浮点元素。如果是表格,则在其中插入表格,如果是figure,则在其中插入数字。

IEEEtran考虑包装说明如何使用 IEEEtran LATEX 类(由软件包作者和维护者编写,第 X 部分),你的 MWE 应该是:

\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}

在此处输入图片描述

相关内容