Settings and Configuration

Settings and Configuration

Setting the terminal

In gnuplot parlance, the "terminal" is the device that renders a plot. While the terminal can be configured in gnuplot's initialization file (e.g. ~/.gnuplot), it is highly recommended to configure the terminal in Gaston, unless you know very well what you are doing.

To set the terminal, run set(terminal="term name"). The default terminal is qt.

Advanced users may want to further refine their terminal configuration. To do this, set the configuration option termopts. This defines a string that is passed to gnuplot at the end of the set term line. For example, if you need a non-enhanced terminal, run `set(termopts="noenhanced").

The available terminals for plotting are:

TerminalPurpose
qtgnuplot's most advanced graphical terminal
wxtolder, also very capable graphical terminal
aquafor Apple users
x11barebones, fallback graphical terminal
dumbplot to the REPL using ASCII
sixelgdplot to the REPL using sixels

For more information on plotting with sixels, see this discourse thread.

Note that, in Jupyter and Juno, the terminal is locked to a special mode that outputs plots as SVG text. The terminal cannot be changed in these environments.

Saving figures

The terminals available for printing (saving) are pdf, eps, svg, png and gif. The following options, if set, will be used by printfigure when saving a plot:

PropertyPurposeAllowed valuesDefaultsetable
print_termTerminal to use for savingSee abovepdf
print_fontFont to use when saving"Font,size"""
print_sizeSize of saved figure"x,y"""
print_linewidthLinewidth of all linesA number in quotes, e.g. "2"""
print_backgroundBackground colorA valid color, e.g. "cyan"""
print_outputfileOutput file nameAny stringNone

Setting a figure's properties

All settings are applied in the following order, in increasing order of precedence:

  1. Gnuplot init file
  2. Options set with set
  3. Options given in a plot command

Options set with the set command affect all future plots. Options given in a plot command affect only that plot.

There are three kinds of configuration options: axes properties, curve properties, and print (save) properties. Axes properties affect the entire figure; curve properties are individual for each plot in the figure. Print properties only affect saving a figure to a file.

For many properties, the default value can be changed using set(property=value). When a property is set to "", gnuplot will use its default value (possibly set in its initialization file).

Gaston's configuration can be reset by running set(reset=true).

Except when indicated otherwise, all values are strings.

See gnuplot's documentation for details of property options and syntax.

Supported axes properties

You may configure the following axes properties:

PropertyPurposeAllowed valuesDefaultsetable
titlePlot titleAny string""
xlabelX axis labelAny string""
ylabelY axis labelAny string""
zlabelZ axis labelAny string""
axisChange axis scaling"semilogy", "semilogx", or "loglog"""
gridShow a grid"on" or a valid grid setting, e.g. "noxtics"""
{x,y,z}rangeX axis limitsA valid range, e.g. "[-3:2]"""
keyoptionsControl key (legends) placementA valid key setting, e.g. "box top left"""
fillstyleStyle for filled curvesA valid fill style, e.g. "solid 0.5"""
boxwidthBox witdh in box plotsA valid boxwidth setting, e.g. "0.5 relative"""
{x,y,z}zeroaxisDraw a line along the selected axis"on" or a valid zeroaxis setting""
paletteColors for pm3d styleA valid palette name, e.g. "gray"""
onlyimpulsesConfigure stem plotstrue or falsefalse
fontPlot fontA valid font spec, e.g. "Consolas,10"""
sizePlot sizeA valid size spec, e.g. "800,600"""
linewidthLinewidth multiplierA number in quotes, e.g. "3"""
backgroundPlot background colorA valid color, e.g. "cyan"""

Supported curve properties

You may configure the following curve properties:

PropertyPurposeAllowed valuesDefaultsetable
"plotstyle"Select plot styleOne of "lines", "linespoints", "points", "impulses", "boxes", "errorlines", "errorbars", "dots", "steps", "fsteps", "fillsteps", "financebars"""
legendCurve descriptionAny string""
linecolorLine colorA valid color, e.g. "red"""
linewidthLine widthA number in quotes, e.g. "2"""
linestyleSelect more complex linesA string containing a combination of -, ., _ and <space>; empty string plots solid lines""
pointsizeMarker sizeA number in quotes, e.g. "2"""
pointtypeMarker styleOne of "", +, x, *, esquare, fsquare, ecircle, fcircle, etrianup, ftrianup, etriandn, ftriandn, edmd, fdmd""
fillcolorColor for filled curvesA valid color, e.g. "red"""
fillstyleStyle for filled curvesA valid fill style, e.g. "solid 0.5"""