# Good quality images in pdflatex

Generally I include images in my latex document by the command

\includegraphics[scale=0.5]{image.png}


However, after doing pdflatex the image quality is always very poor in the resulting pdf file. I think it is probably due to the scaling I do. I have also tried pdf, ps and eps images but they also suffer the same problems. I generally use gnuplot or matplotlib to generate the graphs.

What format should I store the images so that when I scale them to be put in the latex document, they maitain their quality? What are the macros that I should use? As of now I only use

\usepackage{graphics}

-
Do you actually use the graphics package, or graphicx? You should be using the latter. –  Jake Jul 18 '12 at 15:00
I just made a beamer presentation where I used the graphics package but yes in the past I have also used the graphicx package but without any change in quality –  lovespeed Jul 18 '12 at 15:02
Use PDF (vector graphics) images when using pdflatex. –  Weirdstress Function Jul 18 '12 at 15:03
But it seems the plots generated by gnuplot as well as matplotlib in pdf are not very good in quality –  lovespeed Jul 18 '12 at 15:04
@SthitadhiRoy Could you show in your question how you generate the pdf from gnuplot/matplotlib? Usually exporting to pdf should give you vector images, which means perfect quality at any zoom level. –  matth Jul 18 '12 at 16:07

For diagrams you will get the best results when using vector graphics. Both gnuplot and matplotlib can export to vector graphics; file formats for vector graphics are e.g. eps or pdf or svg (there are many more).

As you are using pdfLaTeX, you should choose pdf as output format, because it will be easy to include in your document using the graphicx package and the \includegraphics{} command. To show you how to do it, I went to the matplotlib gallery and downloaded one of the many examples, saving it as myplot.pdf. The following code gives me absolutely satisfying quality.

\documentclass{article}

\usepackage{graphicx}
\usepackage{blindtext}

\begin{document}
\section{Introduction}
Some text and \Blindtext .
%
\begin{figure}%[!thb]
\centering
\includegraphics[width=0.8\linewidth]{myplot.pdf}
\caption{The figure caption should go below the figure.}
\label{fig:myplot}
\end{figure}
%
Some more text and \blindtext and a reference to figure~\ref{fig:myplot}.
Even more text and the end of the text.
\end{document}


PS: As discussed here, jpg is good for photos, png is good for e.g. screenshots.

-