One might get messages like
unknown or ambiguous terminal type; type just ‘set terminal’ for a list
To use png as terminal in GNUPlot, libgd2-dev library is needed (which is not provided in some distributions).
After installing libgd2-dev, one needs to rebuild gnuplot.
Also from: http://xmodulo.com/how-to-export-gnuplot-output-to-png-jpg-and-pdf.html
If you would like to save Gnuplot output as any other formats than those supported by native Gnuplot terminals, you can use redirect operator ¨|¨, to redirect Gnuplot’s native output to an external tool for format conversion.
For example, to export Gnuplot output to pdf format, first install ps2pdf which is contained in ghostscript package. Then redirect Gnuplot’s poscript output to pdf format.
set terminal postscript set output '| ps2pdf - output.pdf'