★ wanayoo — archive 1999 http://feff.phys.washington.edu/~ravel/gnuplot/backend.htmlNouvelle recherche | Portail wanayoo

Using gnuplot-mode as a plotting backend

Gnuplot is commonly used as the plotting backend in other packages. For instance plotting in octave is handled by sending gnuplot commands to gnuplot via a pipeline. When running octave using octave-mode in Emacs, plotting is done by sending a gplot command to the running octave process. An example of an Emacs lisp package which uses gnuplot for plotting is Calc -- the GNU Emacs calculator. It also plots by sending gnuplot commands directly to gnuplot.

Emacs modes which need to supply a plotting interface and which use gnuplot for that purpose may benefit by using gnuplot-mode. Rather than sending gnuplot commands directly to gnuplot, those commands can be written to a buffer in gnuplot-mode. Then the contants can be sent to gnuplot using gnuplot-mode's gnuplot-send-buffer-to-gnuplot function.

This adds the overhead of writing to and maintaining the gnuplot script buffer, however is adds value for the user. By using gnuplot-mode as the plotting backend, the user gets a picture and a gnuplot script which can be modified and replotted.


Gnuplot-mode has several variables which may be useful to a mode which uses gnuplot-mode as its plotting backend.

gnuplot-after-plot-hook
This functions on this hook are run after every invocation of a plotting command.

gnuplot-recently-sent
This variable is set to 'line, 'region, 'buffer, or 'file, depending on what unit of text was most recently sent to gnuplot for plotting.

gnuplot-display-process and gnuplot-info-display
These are useful for controlling multi-window or multi-frame display


Back to the gnuplot-mode homepage.
Back to Bruce's homepage.
Bruce Ravel     Modified: 08-Jul-2000