Hi,
I'm struggling along with my 1st LaTex document. I'm trying to insert two figures on one page. The following seems to work quite nicely:
\begin{figure}[h]
\centering
\includegraphics[scale=0.75]{c:/ma50176/graph1.jpg}
\includegraphics[scale=0.75]{c:/ma50176/graph2.jpg}
\label{fig3}
\end{figure}
However, as soon as I try to insert a caption, it sends the figures (with caption) to the back of my document (instead of where they should be). There is plenty of room after the figures as they are the only things on the page in question. I have tried using the subfigure environment, but that has the same effect.
Any ideas on why this happens and what I can do?
Many thanks,
Lisa
General ⇒ graphics trouble
- localghost
- Site Moderator
- Posts: 9201
- Joined: Fri Feb 02, 2007 12:06 pm
graphics trouble
Modify the list of parameters for placing the floating object.
One parameter alone makes no sense because the compiler will overwrite it (mostly with [ht]). The exclamation mark sets internal LaTeX parameters for float placement to minimal values. If that doesn't help, insert a \clearpage (or \cleardoublepage) command right after the float environment.
Typesetting two figures side by side (with own caption) is well supported by the subfig (and the floatrow) package . Your code then looks a little bit different.
The documentations describe everything in detail.
Best regards
Thorsten¹
Code: Select all
Code, edit and compile here:
\begin{figure}[!ht]\centering\includegraphics[scale=0.75]{c:/ma50176/graph1.jpg}\includegraphics[scale=0.75]{c:/ma50176/graph2.jpg}\caption{Two pictures\label{fig:two-pics}\end{figure}
Typesetting two figures side by side (with own caption) is well supported by the subfig (and the floatrow) package . Your code then looks a little bit different.
Code: Select all
Code, edit and compile here:
\begin{figure}[!ht]\centering\subfloat[First Picture\label{subfig-1:two-pics}]{\includegraphics[scale=0.75]{c:/ma50176/graph1}}\hspace{5mm}\subfloat[Second Picture\label{subfig-1:two-pics}]{\includegraphics[scale=0.75]{c:/ma50176/graph2}}\caption{Two Pictures\label{fig:two-pics}\end{figure}
Best regards
Thorsten¹
Last edited by localghost on Mon Mar 03, 2008 12:42 am, edited 1 time in total.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]
¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Board Rules
Avoidable Mistakes[/size]
¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
graphics trouble
If the above suggestion by localghost still does not place the figures where you want them to be, you can use the \floatplacement command provided by the float package.
1,1,2,3,5,8,13,21,34,55,89,144,233,...