gnuplot Terminals

Enhanced Terminal Mode

Many of the things one plots with gnuplot are associated with special characters, such as superscript for powers, and Greek letters for physical measures (see my web page on plotting a sine wave for an example of using Greek symbols). To enable support for these characters in gnuplot, it is necessary to use the enabled option of the set terminal command. For instance, to include the expression for the area of a circle in the title of a plot, you'd use something like the following:

set terminal wxt enhanced font "arial,14"
set title fn
set xlabel "Surface Area (metres^{2})"

Figure 1: wxt Enhanced

Figure 1: wxt Enhanced

Note, however, that this can cause unexpected problems where the special characters are meant to be treated literally, as depicted above where the first "a" in "area" in the title is shown as a subscript because of the underscore in the file name. For instance, the underscore character is used to generate subscript characters, but it is often used in file names, so if you had a file name my_data.tsv and wanted to show that name in the title, but still have enhanced characters elsewhere in the plot, you'd need to turn off the enhanced option for the set title command. For example:

set terminal wxt enhanced font "arial,14"
set title fn noenhanced
set xlabel "Surface Area (metres^{2})"

Figure 2: wxt Enhanced (Fixed)

Figure 2: wxt Enhanced (Fixed)


Home About Me
Copyright © Neil Carter

Content last updated: 2012-02-20