Graphics, Figures & TablesSpace between figure and text

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
rpedrosb
Posts: 1
Joined: Thu Jul 07, 2016 11:11 am

Space between figure and text

Post by rpedrosb »

Good morning,

I am fairly new to Latex and I'm having problems with some figures. I have some graphs that need to have a caption, so I put them in a figure environment in order to add it, but I'm having a lot more space between the caption and the following text than in a normal figure.

Code for a normal figure:

Code: Select all

\begin{figure}[htp]
  \centering
  \includegraphics[width=14cm]{images/Captura13}
  \caption{Flow velocity vs Pressure drop. Influence of Reynolds number}
  \label{fig:une-autre-image}
\end{figure}

Space is perfectly fine.

Code for the graph figure:

\begin{figure}[ht]
\centering
\begin{tikzpicture}
\begin{semilogxaxis}[
...
]
\addplot[....]
\end{semilogxaxis}
\end{tikzpicture}
\caption{Caption here}
\label{fig:une-autre-image}
\end{figure}
In this case, the space between the caption and the figure is extremely higher. I've tried substituting \begin{center} with \centering and it didn't work. I cannot eliminate the figure positioning because if not it goes to an undesired place.

Any proposal for this problem ? Is there another way for adding captions to my graphs?

Forgive my ignorance!

Thanks a lot.

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

Space between figure and text

Post by Johannes_B »

It is a bit hard to reproduce your issue, since you didn't post a minimal working example.

I think you might be in flushbottom mode and want to be raggedbottom, so add \raggedbottom to your preamble.
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