Graphics, Figures & TablesSubfigure with graphic and matrix; wrong vertical alignment

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
erlendfu
Posts: 2
Joined: Sun Nov 22, 2009 4:59 pm

Subfigure with graphic and matrix; wrong vertical alignment

Post by erlendfu »

Hello!

I need help with some subfigures: graphic to the left, and matrix to the right. The problem is that they don't line up horizontally, because of a gap above the matrix. I have attached the code and a screenshot from my DVI viewer. I have included fboxes to further visualize the problem.

Any help is greatly appreciated!

Code: Select all

\begin{figure}
  \centering
\fbox{\subfigure[X-Compactor circuit]{\label{fig:XCCir-8to5}\includegraphics[width=0.5\textwidth]{figures/XCompact-8to5.eps}}}
  \fbox{\hspace{0.05\textwidth}}
  \fbox{\subfigure[X-Compact matrix]{\label{fig:XCMat-8to5}
$\left[ \begin{array}{ccccc}
1 & 1 & 1 & 0 & 0 \\
1 & 0 & 1 & 1 & 0 \\
1 & 1 & 0 & 1 & 0 \\
1 & 1 & 0 & 0 & 1 \\
1 & 0 & 1 & 0 & 1 \\
1 & 0 & 0 & 1 & 1 \\
0 & 1 & 0 & 1 & 1 \\
0 & 0 & 1 & 1 & 1 
\end{array} \right]$
  }}
  \caption{Example of an X-Compactor with its corresponding matrix, from \cite{MitraXC}.}
  \label{fig:XC-8to5}
\end{figure}
Attachments
subfigure-matrix.gif
subfigure-matrix.gif (14.06 KiB) Viewed 2446 times

Recommended reading 2024:

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

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

erlendfu
Posts: 2
Joined: Sun Nov 22, 2009 4:59 pm

Re: Subfigure with graphic and matrix; wrong vertical alignment

Post by erlendfu »

Update:

I have managed line the figurs up by using floatrow instead of subfig. However, I'm now having problems getting a common caption spanning the width of both figures, as well as (a) and (b) numbering on the subfigure labels. The subfig package makes this automatically.

I don't have time to try anymore today, but I will look into it later. Hints are still very welcome.
Post Reply