Graphics, Figures & Tablessubcaption | 2 side-by-side subfigures do not align

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
hzmonte
Posts: 17
Joined: Sun Nov 16, 2008 8:05 am

subcaption | 2 side-by-side subfigures do not align

Post by hzmonte »

I use the subcaption package in a 2-column document (specifically \documentclass[journal,twoside]{IEEEtran}) to create an overall figure that occupies one column and that consists of two side-by-side subfigures. I cannot get the two subfigures aligned; subfig(a) is on the lower left corner and subfig(b) on the upper right corner.
I read all the following articles and they all have different combinations of width (for the subfigure and includegraphics) -- some use textwidth, some use linewidth. I even tried columnwidth. None worked.
http://tug.org/TUGboat/tb34-1/tb106thurnherr.pdf
http://tex.stackexchange.com/questions/ ... de-figures
http://tex.stackexchange.com/questions/ ... de-by-side
http://blog.pengyifan.com/the-best-way- ... -in-latex/
I don't want to use absolute units such as 3in.

Code: Select all

\begin{figure}[tp]
\centering%
\begin{subfigure}[a]{0.45\columnwidth}%
  \centering%
  \includegraphics[width=0.9\columnwidth]{symmetric}%
  \caption{Symmetric}
  \label{fig:fig_a}
\end{subfigure}%
%\quad%
\begin{subfigure}[b]{0.45\columnwidth}%
  \centering%
  \includegraphics[width=0.9\columnwidth]{asymmetric}%
  \caption{Asymmetric}
  \label{fig:fig_b}
\end{subfigure}%
\caption[mycaption]{mycaption.}
\label{fig:myfig}
\end{figure}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Post Reply