Gnuplot Installation

From ConTeXt wiki

This page contains instructions for installing the gnuplot module and gnuplot with built-in support for the ConTeXt terminal.

Installing Gnuplot

If you don't need the ConTeXt terminal, but would only like to use automatic inclusion of plots from the PostScript terminal, you don't need this.

Binary distribution

You can either wait until the terminal is included into official gnuplot distribution (might take years), if you're working on Windows, you can take an unofficial binary from here; if you're on unix/linux/mac, you have to compile it on your own.

When working under windows you need to have an executable called gnuplot in your PATH. For example, you could make a file gnuplot.bat with the content

"C:\Program Files\gnuplot\wgnupl32.exe" %*

assuming that your gnuplot resides there.

Compiling

You can download gnuplot from CVS repository using

cvs -z3 -d:pserver:anonymous@gnuplot.cvs.sourceforge.net:/cvsroot/gnuplot co -P gnuplot

or simply take a source package from your distribution.

Then you need to compile the code. Under linux it might be

./prepare (or autoconf)
./configure
make
(make install)

Under windows you need to select the proper makefile (makefile.nt4 for MSVC), copy it to src/ under the name Makefile, go there and run nmake.

After one successful compilation, take the file context.trm, copy it to term/ folder and add a line

#include "context.trm"

somewhere to src/term.h and make (install) again.

Installing the module

Additional requirements

  • you need to have a recent version of ConTeXt and texmfstart installed
  • write18 has to be enabled