Graphics, Figures & Tablessubfig | Misalignment of Sub-figures

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
EmceeDIG
Posts: 7
Joined: Wed Oct 17, 2012 12:25 pm

subfig | Misalignment of Sub-figures

Post by EmceeDIG »

I have several figures that are rendered correctly using the subfig package and its \subfloat command. But, I cannot work out why this particular figure compiles to produce alternately placed figures (Please, see attached PNG file). The figure was built using the syntax below:

Code: Select all

\begin{figure}[htb]
\centering
\setlength{\fboxrule}{0.5pt}
\setlength{\fboxsep}{0.05cm}
\subfloat[]{\fbox{\includegraphics[trim=39 11 22 6, clip=true, scale=0.5]{}}\label{}} \quad
\subfloat[]{\fbox{\includegraphics[trim=3 128 33 135, clip=true, angle=-90, scale=0.35]{}}\label{}}
\caption[]{}\label{}
\end{figure}
I did not include "Preamble" matters, because the code works well, with or without the above figure.


Many thanks for your help.
Esuene
Attachments
subfloatFIGplacement_error.png
subfloatFIGplacement_error.png (231.93 KiB) Viewed 4240 times
Last edited by EmceeDIG on Mon Oct 29, 2012 2:15 pm, edited 2 times in total.

Recommended reading 2024:

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

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

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

subfig | Misalignment of Sub-figures

Post by Stefan Kottwitz »

Hi Esuene,

for uploading images please click the "Upload attachment" link below the text edit field when writing or editing. And use the "Code" button for posting longer LaTeX code. Btw. the code above is not a Infominimal working example aka MWE, have a look at the link.

Regarding your problem: subfigure is obsolete, use the newer subfig package of the same author, or subcaption.

Stefan
LaTeX.org admin
EmceeDIG
Posts: 7
Joined: Wed Oct 17, 2012 12:25 pm

Re: subfig | Misalignment of Sub-figures

Post by EmceeDIG »

HI Stefan_K,

I've edited my initial post as you advised. Could you take another look at it, please?

Thank you.

EmceeDIG
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

subfig | Misalignment of Sub-figures

Post by Stefan Kottwitz »

In this line

Code: Select all

\subfloat[]{\fbox{\includegraphics[trim=3 128 33 135,
    clip=true, angle=-90, scale=0.35]{}}\label{}}
you turn the image by 90 degrees, so it goes down. Before, the baseline for alignment was at the bottom, afterwards it's at the top. Try it without angle, rotate the image otherwise for example, or use further arguments such as origin=tl.

Stefan
LaTeX.org admin
EmceeDIG
Posts: 7
Joined: Wed Oct 17, 2012 12:25 pm

Re: subfig | Misalignment of Sub-figures

Post by EmceeDIG »

Thanks, Stefan_K.
Post Reply