Good quality images in pdflatex
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.