子圖的標題未居中

子圖的標題未居中

影像

圖 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.1a 中兩個圖的寬度展開

答案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 的有用評論。)

相關內容