Graphics, Figures & TablesCaptions at the bottom but pictures at the top (using put)

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
touqra
Posts: 2
Joined: Fri Aug 17, 2012 4:46 am

Captions at the bottom but pictures at the top (using put)

Post by touqra »

Hi,

I am trying to use picture and put commands to place two figures. I can't use the subfigure package, as both figures did not align at the bottom.
But using picture, the caption came out to be way at the bottom of the page but the pictures are on the top of the same page. It's as if there's some invisible pictures included in the middle.
How can I fix this ?

Thanks.

Code: Select all

\begin{figure}[!h]
  \begin{center} 
    \begin{picture}(5100,115)
      \put(0,210){
	\includegraphics[height=5cm]{fig1.pdf}}
      \put(225,220){
	\includegraphics[height=5cm]{fig11.png}}
\end{picture}
\caption{The figures}
 \end{center}
\end{figure}
Last edited by Stefan Kottwitz on Fri Aug 17, 2012 8:04 am, edited 1 time in total.

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

touqra
Posts: 2
Joined: Fri Aug 17, 2012 4:46 am

Re: Captions at the bottom but pictures at the top (using pu

Post by touqra »

Hi,

I solved my problem with using textpos instead. Sorry for the hoo-hahs.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10350
Joined: Mon Mar 10, 2008 9:44 pm

Captions at the bottom but pictures at the top (using put)

Post by Stefan Kottwitz »

Hi touqra,

welcome to the board!

Good to see, that your problem is solved. Thanks for posting your solution!

Regarding the alignment: you could use \parbox or a {minipage} environment with an optional vertical alignment argument, or \raisebox. I would not use \put and a picture environment. Such placement with absolute values is possible, but somehow static, not optimal for a LaTeX document.

Some further small remarks: in a figure environment, I would use \centering instead of \begin{center} ... \end{center}, see center vs. \centering for an explanation.

And !h as the only positioning arguments are too few. You don't even allow floating to the top of the next page, which can result in a bad page break if the figure doesn't fit completely to the page. ht or !ht would be the minimum for me. Most flexible placement is !htbp. The parameters are explained here:
Order of appearance of tables and figures.

As I see you use the picture environment: if you produce graphics using picture, perhaps have a look at TikZ, which is very capable, see the TikZ example gallery. Alignment and even absolute positioning are easy with TikZ.

I hope some of the remarks are useful for you. If you have a follow-up question, for example if you start using TikZ, feel free to open a new topic.

Stefan
LaTeX.org admin
Post Reply