Graphics, Figures & TablesAdjust Height of Sub-figures relative to each other

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
User avatar
avi9526
Posts: 6
Joined: Mon Mar 12, 2012 2:04 pm

Adjust Height of Sub-figures relative to each other

Post by avi9526 »

Hi!
I need to create some figure with subfigures. My problem is that for "nice look" subfigures must have same height (original files have). I found solution with subfigures package. But next I read that it was deprecated :? So I use hand-adjusting but this is not a "good way" I think.

What to do?

My main tex file and all stuff in attachment.

Code: Select all

\documentclass[a4paper, 12pt, english, russian, ukrainian]{article}
\RequirePackage{geometry}
	\geometry{left=30mm}
	\geometry{right=15mm}
	\geometry{top=15mm}
	\geometry{bottom=25mm}
\RequirePackage[T1, T2A]{fontenc}
\RequirePackage[utf8]{inputenc}
\RequirePackage{babel}
\RequirePackage{
	amssymb,
	amsfonts,
	amsmath,
	mathtext,
	mathrsfs,
	cite,
	enumerate,
	lipsum,
	float,
	multicol,
	titlesec,
	caption,
	subcaption,
	lipsum
	}
\RequirePackage{graphicx}

\begin{document}

\begin{figure}[h!]
	\lipsum[1]
	\centering
	\begin{minipage}[h]{0.35\linewidth}
		\center{\includegraphics[width=1\linewidth]{DAC-Signals-a}} a)\\
	\end{minipage}
	\hspace{0.01\linewidth}
	\begin{minipage}[h]{0.53\linewidth}
		\center{\includegraphics[width=1\linewidth]{DAC-Signals-a-Freq}} b)\\
	\end{minipage}
	\vfill
	\begin{minipage}[h]{0.35\linewidth}
		\center{\includegraphics[width=1\linewidth]{DAC-Signals-b}} c)\\
	\end{minipage}
	\hspace{0.01\linewidth}
	\begin{minipage}[h]{0.53\linewidth}
		\center{\includegraphics[width=1\linewidth]{DAC-Signals-b-Freq}} d)\\
	\end{minipage}
	\caption{Figures}
	\label{fig - DAC Signals in Time and Freq Domain}
	\lipsum[2]
\end{figure}

\end{document}
Attachments
AskTex.zip
my example
(95.69 KiB) Downloaded 184 times
MS Word -> OpenOffice -> LibreOffice -> LaTeX

Recommended reading 2024:

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

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

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Adjust Height of Sub-figures relative to each other

Post by localghost »

I can't see where the sub-figures don't have the same height. Regarding your code there are some points for improvement.
  • In documents we use \usepackage instead of \RequirePackage. The latter one is for code inside packages.
  • You don't need an extra \geometry command for very single element of the page geometry. The command accepts a comma separated list of arguments.
  • For sub-figures you should consider to use an appropriate package (only one).
  • You could draw those pictures by a graphics package (provided that you know the depicted functions). You would have better control about the height of the diagrams.
If want to keep those diagrams in external graphics files, you may take a look at the »keepaspectratio« option for the graphicx package which is described in its manual.


Thorsten
User avatar
avi9526
Posts: 6
Joined: Mon Mar 12, 2012 2:04 pm

Adjust Height of Sub-figures relative to each other

Post by avi9526 »

localghost wrote:I can't see where the sub-figures don't have the same height.
1) Its because I adjust their height manualy by changing width:

Code: Select all

...
\begin{minipage}[h]{0.35\linewidth}
...
\begin{minipage}[h]{0.53\linewidth}
...
I set minipage width but don't know how to set height. Spend 2min to find appropriate width value for this figures.
If figures will be changed - I will need do it again :|

2) Subfig package allow to set height, but wikibooks says that subfig package is deprecated wikibooks

3) I cant find in subcaption manual pdf any words about how to set height.
MS Word -> OpenOffice -> LibreOffice -> LaTeX
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Adjust Height of Sub-figures relative to each other

Post by sommerfee »

avi9526 wrote:2) Subfig package allow to set height
How? I'm not aware of a feature of the subfig package which allows the setting of a subfigure height.
Post Reply