Graphics, Figures & Tables ⇒ Two basic Graphics Questions: Placement and Matlab
Two basic Graphics Questions: Placement and Matlab
first question: I am using the following code to insert a jpeg from file into my PDF document:
\vspace{0.25cm}
\begin{figure}[!htbp]
\begin{center}
\leavevmode
\ifpdf
\includegraphics[height=3in]{res}
\fi
\caption{Response}
\label{FigAir}
\end{center}
\end{figure}
\vspace{0.25cm}
however, when latex judges this to be near the end of the page, it will force the graphic onto the next page and thus "seperate it" from the writing that came before in the tex file layout. How can I force the jpeg to appear in order with the tex writing, even if it means leaving white space on a page?
Ques 2. I am saving images made in matlab (eg graphs) as jpeg files and importing them into latex (as above). On making the PDF the graphic looking awful -- really low resolution.
What am I doing wrong?
Has anyone used this: http://www.mathworks.com/matlabcentral/ ... matlabfrag
Thank you
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
Two basic Graphics Questions: Placement and Matlab
A much better option for exporting vector based images such as graphs from matlab is exporting it to pdf. Pdf supports vectors, and you will experience no loss of quality if you include it in your LaTeX document. I use pdf for all the graphs I export from R and want to include in my LaTeX document.
I'm a LaTeX beginner, so i'm not sure what some of the commands you use in your script do... but you're using htbp, and this should place your document either here (where you place it in your script), top, bottom, different page. So that you're doing right. Perhaps your image is simply to large, I would leave away the vertical space and put the image at the same width at the textsize, example:
Code: Select all
\includegraphics[width=1.0\textwidth]{bhc_pec_truncated.pdf}