Graphics and Images

This page describes various graphical and image processing facilities, namely:

  • xgraph – A simple plotting program.
  • xfig – A program for drawing figures.
  • gimp – The GIMP – an image manipulation program.
  • ImageMagick – a set of graphics display and coversion tools.
  • Scanning images off paper.

xgraph – A simple plotting program

The xgraph program plots simple graphs, displaying them in a window that it creates. Its simplest usage is as follows:

xgraph datafile

Here, datafile is a file containing coordinates of points, one per line, with the X and Y coordinates separated by spaces (not commas). These points will be drawn connected by lines, with axes that are automatically scaled to the range of X and Y.

You can plot several graphs superimposed by specifying more than one datafile, or by putting several datasets in one file, separated by a blank lines. Various options allow one to plot points instead of or as well as lines, to plot on a log scale, and to change titles, etc. One can convert plots to Postscript, and send them to the printer. See “man xgraph” for more details.

Most of these things can also be done with the plotting facilities in S-Plus or other packages. The main advantage of xgraph is that it’s convenient to use for simple tasks. If xgraph is given no datafile, it reads from standard input, which makes if particularly useful for plotting data produced by some program, as in

myplotprogram | xgraph

xfig – A program for drawing figures

The xfig program lets you draw things using the mouse. It is useful for creating figures in papers. You can also use it to add things (eg, captions) to images produced elsewhere, such as plots produced by S-Plus. The figures can be converted to Postscript for printing or for inclusion in another document.

Figures created with xfig are usually stored in files with names ending in “.fig”. To create a new figure, or make changes to an existing figure, start up xfig with the name of the figure file as an argument. For example:

xfig boxes.fig

starts up xfig in order to create or change boxes.fig.

When you are in xfig, you should be able to draw lines, circles, etc. by first clicking on an icon on the left with the left mouse button, and then using the mouse to specify locations for the object in the main drawing area, using various of the mouse buttons (see the top right for hints). You can also add text with the “T” icon, and other images in various formats with the “Picture Object” icon.

You can save the figure you have drawn using the “File…” button at the top. You can also produce a version of the figure in Postscript or various other formats using the “Export…” button. The “Encapsulated Postscript” format is designed for inclusion in other documents (eg, as a Latex figure).

See the xfig documentation for further details.

The GIMP

GIMP is an acronym for GNU Image Manipulation Program. It is a freely distributed piece of software suitable for such tasks as photo retouching, image composition and image authoring.

If you are looking for a program like Photoshop, then the GIMP is for you.

You can start the GIMP by typing

gimp

at the command line.

Extensive help is available at the main GIMP documentation page.

ImageMagick

ImageMagick is a set of programs used to convert graphics formats and perform certain modifications to images. The most useful programs are:

display

Displays an image on the screen. See man display for details.

import

Takes a “screenshot” of any part of the display. See man import for details.

convert

Converts a graphics file from one format to another, e.g. jpeg to gif. See man convert for details.

identify

Describes some of the characteristics of the graphics file. See man identify for details.

Other commands include animate, montage, mogrify, and conjure. See their manual pages for details. More extensive documentation is available at the ImageMagick homepage.

Scanning images off paper

We’ll let you know when the scanner works.

Print Friendly