Graphics, Figures & TablesSubfigure positions

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
kaszpore
Posts: 5
Joined: Fri Aug 11, 2017 3:15 pm

Subfigure positions

Post by kaszpore »

Hi Everybody,

I need some help with positioning figures using subfigure. I have two figures, Fig1 and Fig2, I want them in the same {figure} environment, appearing next to each other. The problem is that Fig2 is considerably smaller along the vertical direction, and hence it is shifted upwards with respect to Fig1. It looks incredibly clumsy. I would like to match the bottom of the two figures, so the captions are aligned.

How can I do that?

Many thanks in advance!

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Subfigure positions

Post by Johannes_B »

Welcome, can you show us the code to reproduce your actual case?
Package subfigure is deprecated for more than a decade now. These days, people would use the subcaption package.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
kaszpore
Posts: 5
Joined: Fri Aug 11, 2017 3:15 pm

Subfigure positions

Post by kaszpore »

Here is the code:

Code: Select all

\begin{figure}
\begin{subfigure}{0.5\textwidth}
	\centering
	\includegraphics[scale=0.5]{Fig1.pdf}
	\caption{qwert}
	\label{fig:Fig1}
\end{subfigure}
\begin{subfigure}{0.5\textwidth}
	\centering
	\includegraphics[scale=0.5]{Fig2.pdf}
	\caption{asdfg}
	\label{fig:Fig2}
\end{subfigure}
\end{figure}
I am sorry, I am quite new to LaTeX, this is the first time I try do do this. I was not aware that subfigure is deprecated. I would gladly switch to the recommended package.
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Subfigure positions

Post by rais »

Your code snippet looks to me like you're already using the right package (subcaption).
What you're looking for is called \subcaptionbox, if I understand you correctly.
See in `texdoc subcaption' the description to \subcaptionbox---there's a nice example with a cat and an elephant ;)

KR
Rainer
kaszpore
Posts: 5
Joined: Fri Aug 11, 2017 3:15 pm

Subfigure positions

Post by kaszpore »

That's exactly what I was looking for! Thank you so much!
Post Reply