THE META-HTML LANGUAGE REFERENCE MANUAL

Color Manipulation [TOC] Powerstrip System Tags

Section Intro: Using Gnuplot

Using Gnuplot

Synopsis:

    Meta-HTML contains a few functions which make it easy to generate plots and graphs of data that you have available to you.

    The use of the functions requires `gnuplot', a copy-lefted graphing program widely available on the Internet (e.g., ftp://prep.ai.mit.edu/pub/gnu).

    Using the gnuplot::plot-alists function, you can create PostScript and/or GIF images of a single set of data, or overlay many data sets in a single graph.

    Some terminology common to gnuplot may facilitate the reading of the function documentation: a tic is a mark which appears on the axes of the final graph indicating the value along that axis -- there are tics in both the X and Y directions. Tics can be labeled, you will have to read the documentation of gnuplot for more information on that flexible format.

Commands:

<gnuplot::make-gif-plot DATA &optional [OUTPUT-FILE] &key [STYLE] [XLABEL] [YLABEL] [TITLE] [XTICS] [YTICS]Simple

    Create a GIF plot of the points in DATA, using STYLE (default 'boxes') and perhaps labelling the X and Y axes.

    The output GIF will be stored in OUTPUT-FILE, or returned directly to *standard-output*, (in which case, the output stream is then closed).

    The default value for TITLE is "Unspecified Data Graph".

    Possibilities for STYLE are: lines, points, linespoints, impulses, dots, steps, fsteps, histeps, errorbars, xerrorbars, yerrorbars, xyerrorbars, boxes, boxerrorbars, boxxyerrorbars, financebars, candlesticks or vector.

<gnuplot::make-ps-plot DATA &key [STYLE] [XLABEL] [YLABEL] [TITLE] [XTICS] [YTICS] [XTICS-ROTATE]Simple

    Create a PostScript plot of the points in DATA, using STYLE (default 'boxes') and perhaps labelling the X and Y axes.

    The default value for TITLE is "Unspecified Data Graph".

    This function returns the PostScript text necessary to produce the graph itself -- the text could be passed to a PostScript printer, or, one could use to create a GIF image suitable for displaying on a Web page.

    Possibilities for STYLE are: lines, points, linespoints, impulses, dots, steps, fsteps, histeps, errorbars, xerrorbars, yerrorbars, xyerrorbars, boxes, boxerrorbars, boxxyerrorbars, financebars, candlesticks or vector.

     <set-var data = "20 45 40 47 68 98">
     <set-var ps = <gnuplot::make-ps-plot <get-var-once data[]> title="Foo">>
     

<gnuplot::plot-alist-internal STREAM ALISTSimple

    You pass in STREAM and an ALIST containing:

    • DATA-FUNCTION: The name of the function which generates the points
    • DATA-FUNCTION-ARGS: Arguments to pass to DATA-FUNCTION
    • TITLE: A title for this data (defaults to DATA-FUNCTION).
    • STYLE: The style for plotting. See (gnuplot::make-plot).
    • SCALE: A factor for scaling the data.

<gnuplot::plot-alists &optional [ALISTS[]] &key [OUTPUT-TYPE] [VARNAME] [OUTPUT-FILE] [ROTATION] [XLABEL] [YLABEL] [XTICS] [YTICS] [XTICS-ROTATE] [BOXWIDTH] &rest alists[]>Simple

    For now, see gnuplot::plot-alist-internal.

    Call `gnuplot' to actually generate the plot from the data. The default output type is GIF (works with gnuplot 3.6 and greater).

<gnuplot::postscript-to-gif PS-DATA &key [FILENAME] [VARNAME]Simple

    Using the PostScript text in PS-DATA, create a GIF image suitable for display from a Web page.

    If FILENAME=FOO.GIF is specified, then the GIF image will be written to "foo.gif", and the function returns "true" if successful.

    If VARNAME=GIF-VAR is specified, then the GIF image will be placed into the binary variable "GIF-VAR", and the function returns "true" if successful.

    If neither FILENAME nor VARNAME is specified, the function writes the raw data of the GIF image as an HTML document to the standard output, and closes the standard output stream. This is to facilitate the creation of Web pages which produce GIF images as output.

Edit Section
Function Index
Variable Index


The META-HTML Reference Manual V2.0 Copyright © 1995, 1998, Brian J. Fox
Found a bug? Send mail to bug-manual@metahtml.org