General ⇒ Figure caption appears on top of figure after cropping
Figure caption appears on top of figure after cropping
I'm trying to insert a figure into a document. However, the figure is too large to fit as is, so I've cropped the image using the viewport option for \includegraphics. While this makes the figure fit on the page, the figure caption is now overlaid on top of the figure (towards the bottom, but obviously not quite where I need it to be).
If anybody has any insights about a fix (e.g., how to specify the position of a caption), that would be marvelous!
Here's the relevant code:
\begin{landscape}
\begin{figure}[h]
\begin{center}
\includegraphics[viewport = 250 200 550 500]{figure}
\caption{the offending figure caption}
\label{fig:figure}
\end{center}
\end{figure}
\end{landscape}
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
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Figure caption appears on top of figure after cropping
welcome to the LaTeX Community board!
The caption package could be useful for you. It provides many features and much flexibility and is well documented.
By the way: I would not use \begin{center} ... \end{center}, I prefer \centering instead, because the center environment produces additional vertical space, in your case probably even more unwanted.
Stefan