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
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
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}