Created: 2012-03-23 13:35
Updated: 2016-07-13 06:32


A simple LaTeX package for including gnuplot charts into a document.


Place gnuplot.sty either to same folder as your document or (for system wide install) copy the file to TeX distrubution folder.

  • on Debian like distros:

    sudo mkdir /usr/share/texmf-texlive/tex/latex/gnuplot sudo cp gnuplot.sty /usr/share/texmf-texlive/tex/latex/gnuplot/gnuplot.sty sudo texhash


Insert following into your preamble:


Test plot:


By default output format is pdf and it's stored in same folder as your LaTeX document. If you want to change this, define a directory name (this directory must exists):



To make it work, you have to add -shell-escape option to pdflatex

pdflatex -shell-escape *.tex

It allows pdflatex to execute bash commands which is generally unsafe option. Make sure that gnuplot.sty does not containg any rm -rf commands :)

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more