Go to the first, previous, next, last section, table of contents.


Plotting with Gnuplot

Several time throughout this tutorial, we plotted graphical output using the specialize and built-in plotting functions in @fuse{}. In this chapter, I will describe how these functions work and how you can further interact with GNUPLOT from within Emacs.

One of the files that ships with @fuse{} is `gnuplot.el' which defines `gnuplot mode' for Emacs. `gnuplot mode' is an emacs major mode for creating gnuplot scripts and sending them to gnuplot. In the `docs' directory of the @fuse{} distribution there is a reference card for `gnuplot mode' called `gpelcard.ps'. This is a two page summary of the features of `gnuplot mode' in PostScript format. You should refer to that for complete details about `gnuplot mode'.

The basic idea behind `gnuplot mode' is that you can create a script for GNUPLOT in the `gnuplot mode' buffer and use functions to send parts or all of the script to a GNUPLOT process. The various plotting functions in @fuse{} work by reading the input file to determine the names of the files to plot(5) and writes a script in the `gnuplot mode' buffer. It then uses the function for sending the entire buffer to GNUPLOT to display the plot.

For many common plotting chores during your analysis of EXAFS data, it quite suffices to simply use the functions offered by @fuse{}. For looking at such common things as fit results and background removals, these functions work well. The nice feature of the manner in which @fuse{} creates its graphical output is that it leaves you with a script that you can modify. Often it is simple and quicker to modify one of the scripts written by @fuse{} than to create an entire script from scratch.

`gnuplot mode' provides four functions for sending parts of scripts to gnuplot. There are functions for sending the line currently occupied by the screen cursor (C-c C-l), a marked region (C-c C-r), or an entire buffer (C-c C-b). There is also a function for sending an external file (C-c C-f) to GNUPLOT. All four of these can be found in the `Gnuplot' menu. The line, region, and buffer functions are also bound to the toolbar in XEmacs.

@fuse{} maintains a history of scripts sent to GNUPLOT. If you want to revisit an earlier plot, either one written by @fuse{} or one that you wrote and sent to GNUPLOT, you can navigate the script history. C-c C-p steps backwards to previous scripts and C-c C-n steps forward to more recent scripts. These twop commands are bound to the up and down arrows in the XEmacs toolbar for `gnuplot mode'.

`gnuplot mode' also offers keyword completion, interaction with the GNUPLOT document, syntax colorization of GNUPLOT keywords, and direct interaction with the GNUPLOT process. See the reference card for more details.


Go to the first, previous, next, last section, table of contents.