next up previous contents index
Next: Gnugraph(GNU plotutils) Up: Terminal Previous: Ggi   Contents   Index


Gif

Syntax:

     set terminal gif 
                      {tiny | small | medium | large | giant}
                      {{no}transparent} {{no}enhanced}
                      {font <face> {<pointsize>}}
                      {animate {delay <time>} {{no}optimize}}
                      {size <x>,<y>} {{no}crop}
                      {<color0> <color1> <color2> ...}

GIF images are created using libgd, with optional support for TrueType fonts via libfreetype.

GIF plots may be conveniently viewed by piping the output to the 'display' program from the ImageMagick package as follows:

              set term gif
              set output '| display gif:-'

View the output from successive plot commands interactively by hitting 5#5space6#6 in the display window. To save a particular one to disk, left click in the display window and choose save.

Five basic fonts are supported directly by the gd library. These are tiny (5x8 pixels), small (6x12 pixels), medium, (7x13 Bold), large (8x16) or giant (9x15 pixels). These fonts cannot be scaled or rotated (pure horizontal or vertical text only).

transparent instructs the driver to generate transparent GIFs. The first color will be the transparent one. Default is notransparent.

enhanced enables the enhanced text processing features, (subscripts, superscripts and mixed fonts). See enhanced (p. [*]) for more information. The full enhanced mode syntax is supported by the PNG/GIF driver itself, but some of these features are dependent on which version of the underlying libgd library is present, and which fonts are available.

If your local gd library was built with support for TrueType and Adobe Type 1 fonts, they may be selected using the 'font 5#5face6#6 {5#5pointsize6#6}' option. 5#5face6#6 is either the full pathname to the font file, or a font face name that is assumed to be the first part of a filename in one of the directories listed in the GDFONTPATH environmental variable. That is, 'set term gif font "Face"' will look for a font file named either 5#5somedirectory6#6/Face.ttf or 5#5somedirectory6#6/Face.pfa. Both TrueType and Adobe Type 1 fonts are fully scalable and may be rotated through any angle. If no font is specified, gnuplot checks the environmental variable GNUPLOT_DEFAULT_GDFONT to see if there is a preferred default font.

The animate option is available only if your local gd library supports the creation of animated gifs. The default delay between display of successive images may be specified in units of 1/100 second (default 5). The actual delay may vary depending on the program used as a viewer. An animation sequence is terminated by the next set output or set term command. The optimize option has two effects on the animation.

1) A single color map is used for the entire animation. This requires that all colors used in any frame of the animation are already defined in the first frame.

2) If possible, only the portions of a frame that differ from the previous frame are stored in the animation file. This space saving may not be possible if the animation uses transparency.

Both of these optimizations are intended to produce a smaller output file, but the decrease in size is probably only significant for long animations or very small frame sizes. The nooptimize option turns off both of the effects just described. Each frame is stored in its entirety along with a private color map. Note that it is possible to post-process a non-optimized animation using external utilities, and this post-processing can yield a smaller file than gnuplot's internal optimization mode. The default is nooptimize.

The size 5#5x,y6#6 is given in pixels -- it defaults to 640x480. The number of pixels can be also modified by scaling with the set size command. crop trims blank space from the edges of the completed plot, resulting in a smaller final image size. Default is nocrop.

Each color must be of the form 'xrrggbb', where x is the literal character 'x' and 'rrggbb' are the red, green and blue components in hex. For example, 'x00ff00' is green. The background color is set first, then the border colors, then the X & Y axis colors, then the plotting colors. The maximum number of colors that can be set is 256.

Examples:

     set terminal gif medium size 640,480 \
                      xffffff x000000 x404040 \
                      xff0000 xffa500 x66cdaa xcdb5cd \
                      xadd8e6 x0000ff xdda0dd x9500d3    # defaults

which uses white for the non-transparent background, black for borders, gray for the axes, and red, orange, medium aquamarine, thistle 3, light blue, blue, plum and dark violet for eight plotting colors.


     set terminal gif font 'arial' 14 size 800,600

which searches for a TrueType font with face name 'arial' in the directory specified by the environment variable GDFONTPATH and 14pt font size.


next up previous contents index
Next: Gnugraph(GNU plotutils) Up: Terminal Previous: Ggi   Contents   Index
Ethan Merritt 2007-03-03