Graphics, Figures & TablesLatex Figure Problem

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
sercandemir
Posts: 3
Joined: Mon Jan 19, 2015 6:52 pm

Latex Figure Problem

Post by sercandemir »

Hello. I am putting two figures using the code below

Code: Select all

\begin{figure}[h]
  \centering
  \includegraphics[width=150mm]{t1&t4}
 \vspace*{-0.8 in} \caption {Comparison of the Profit Function between Case B and Case C.3}
\end{figure}
I want to write some comments between them but in the pdf file my comments are not between 2 figures.
Also, When I add a third figure, it goes to other page. It is frustrating.

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

Latex Figure Problem

Post by Johannes_B »

It should not be frustrating, as we already explained what floating environments do.

The simplest cause might be, that there is simply not enough space left on the page.
If you really want to stick everything together, use something like:

Code: Select all

\documentclass{article}
\usepackage{mwe}
\begin{document}
\blindtext
\begin{figure}
\includegraphics[height=0.3\textheight]{example-image-a}
\caption{This is you caption, it is nice.}
\blindtext\par
\includegraphics[height=0.3\textheight]{example-image-b}
\caption{this is another figure. It is almost as nice as the first.}
\includegraphics[height=0.3\textheight]{example-image-c}
\caption{This is the last figure, ugly as hell.}
\end{figure}
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply