I am using MikTex 2.8, Vista, WinEdt 6.0 and Matkab 2009a and Matlab 2010a
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
Graphics, Figures & Tables ⇒ Two basic Graphics Questions: Placement and Matlab
NEW: TikZ book now 40% off at Amazon.com for a short time.

Two basic Graphics Questions: Placement and Matlab
Hi, First of all I would stay away from the jpg format when dealing with vector based images, it´s horrible. You better export your images from matlab in tiff or png at a high resolution. Both format are lossless and have basically the same quality, however png files are abit smaller in filesize.
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:
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}
Re: Two basic Graphics Questions: Placement and Matlab
As for placement, try changing \begin{figure}[!htbp] to simply \begin{figure}[!h].