子图的标题未居中

子图的标题未居中

图像

图 4.1 是两个子图,每个子图都有一个标题(技术上总共有四个图,但行上的图是一张图片)。

使用

\documentclass[twocolumn,titlepage]{report}

 \usepackage{verbatim}
\usepackage{amsfonts}
\usepackage{amsmath}
%%\usepackage{subfigure}
\usepackage{amssymb}
\usepackage[pdftex]{graphicx}
\usepackage{geometry}
\usepackage{titlesec}
\usepackage[center]{caption}
\usepackage{subcaption}

\titleformat{\chapter}[block]
 {\normalfont\huge\bfseries}{\thechapter}{1em}{}

\geometry{
  body={7in, 10in},
  left=0.75in,
  top=0.5in
}

\begin{document}

\begin{figure}[ht]
       \begin{subfigure}[b]{0.3\textwidth}
          \includegraphics[width=8.7cm]{fig5-a.png}
      \caption{\textit{I-V Charactaristic at 1Hz (left) and 5 Hz (right)}}
   \end{subfigure}
       \begin{subfigure}[b]{0.3\textwidth}
          \includegraphics[width=8.7cm]{fig8.png}
      \caption{\textit{I-V Charactaristic at 10 Hz (left) and 500Hz (right)}}
\end{subfigure}
    \caption{I-V Charactaristics of varying frequencies, showing the expected tightening of the bow}
    \label{fig:freqdep}
 \end{figure}    
\end{document}

标题没有与整个图对齐。理想情况下,标题应该横跨图 4.1 a 中两个图的宽度

答案1

您已将每个子图的宽度指定为0.3\textwidth,并设置了标题的宽度。但包含的图形要宽得多,因此会突出。

为了解决这个问题,请将子图的宽度设置为整列宽度:

\documentclass[twocolumn]{article}
\usepackage[draft]{graphicx}
\usepackage{subcaption}
\begin{document}
   \begin{figure}[ht]
      \begin{subfigure}[b]{\columnwidth}
         \includegraphics[width=\columnwidth]{fig5-a.png}
         \caption{\textit{I-V Charactaristic at 1Hz (left) and 5 Hz (right)}}
      \end{subfigure}
      \begin{subfigure}[b]{\columnwidth}
          \includegraphics[width=\columnwidth]{fig8.png}
          \caption{\textit{I-V Charactaristic at 10 Hz (left) and 500Hz (right)}}
      \end{subfigure}
      \caption{I-V Charactaristics of varying frequencies, showing the expected tightening of the bow}
      \label{fig:freqdep}
   \end{figure}
\end{document}

(感谢 egreg 的有益评论。)

相关内容