next up previous contents index
Next: X11_fonts Up: Terminal Previous: Wxt   Contents   Index


gnuplot provides the x11 terminal type for use with X servers. This terminal type is set automatically at startup if the DISPLAY environment variable is set, if the TERM environment variable is set to xterm, or if the -display command line option is used.


  set terminal x11 {<n>}
                   {title "<string>"}
                   {font <fontspec>}
                   {{no}persist} {{no}raise} {solid|dashed} {{no}ctrlq}
  set terminal x11 {reset}

Multiple plot windows are supported: set terminal x11 5#5n6#6 directs the output to plot window number n. If n is not 0, the terminal number will be appended to the window title (unless a title has been supplied manually) and the icon will be labeled Gnuplot 5#5n6#6. The active window may be distinguished by a change in cursor (from default to crosshair).

The x11 terminal support enhanced text mode (see enhanced (p. [*])), subject to the available fonts. In order for font size commands embedded in text to have any effect, the default x11 font must be scalable. Thus the first example below will work as expected, but the second will not.

  set term x11 enhanced font "arial,15" 
  set title '{/=20 Big} Medium {/=5 Small}'

  set term x11 enhanced font "terminal-14" 
  set title '{/=20 Big} Medium {/=5 Small}'

Plot windows remain open even when the gnuplot driver is changed to a different device. A plot window can be closed by pressing the letter q while that window has input focus, or by choosing close from a window manager menu. All plot windows can be closed by specifying reset, which actually terminates the subprocess which maintains the windows (unless -persist was specified). The close command can be used to close individual plot windows by number. However, after a reset, those plot windows left due to persist cannot be closed with the command close. A close without a number closes the current active plot window.

The gnuplot outboard driver, gnuplot_x11, is searched in a default place chosen when the program is compiled. You can override that by defining the environment variable GNUPLOT_DRIVER_DIR to point to a different location.

Plot windows will automatically be closed at the end of the session unless the -persist option was given.

The options persist and raise are unset by default, which means that the defaults (persist == no and raise == yes) or the command line options -persist / -raise or the Xresources are taken. If [no]persist or [no]raise are specified, they will override command line options and Xresources. Setting one of these options takes place immediately, so the behaviour of an already running driver can be modified. If the window does not get raised, see discussion in raise (p. [*]).

The option title "5#5title name6#6" will supply the title name of the window for the current plot window or plot window 5#5n6#6 if a number is given. Where (or if) this title is shown depends on your X window manager.

The size or aspect ratio of a plot may be changed by resizing the gnuplot window.

Linewidths and pointsizes may be changed from within gnuplot with set linestyle.

For terminal type x11, gnuplot accepts (when initialized) the standard X Toolkit options and resources such as geometry, font, and name from the command line arguments or a configuration file. See the X(1) man page (or its equivalent) for a description of such options.

A number of other gnuplot options are available for the x11 terminal. These may be specified either as command-line options when gnuplot is invoked or as resources in the configuration file ".Xdefaults". They are set upon initialization and cannot be altered during a gnuplot session. (except persist and raise)

next up previous contents index
Next: X11_fonts Up: Terminal Previous: Wxt   Contents   Index
Ethan Merritt 2007-03-03