^
2"
will write x-squared as we are used to seeing it, with a superscript 2.
This mode is selected by default when you set the terminal, but may be
toggled afterward using "set termoption [no]enhanced", or by marking
individual strings as in "set label 'x_2' noenhanced".
Enhanced Text Control Codes | |||
Control | Example | Result | Explanation |
^ |
a^x |
6#6 | superscript |
_ |
a_x |
7#7 | subscript |
@ |
a@^b_{cd} |
8#8 | phantom box (occupies no width) |
& |
d&{space}b |
d b |
inserts space of specified length |
~ |
~a{.8-} |
9#9 | overprints '-' on 'a', raised by .8 |
|
|
times the current fontsize | |
|
{/Times abc} |
abc | print abc in font Times at current size |
|
{/Times*2 abc} |
abc | print abc in font Times at twice current size |
|
{/Times:Italic abc} |
abc | print abc in font Times with style italic |
|
{/Arial:Bold=20 abc} |
abc | print abc in boldface Arial font size 20 |
\U+ |
\U+221E |
10#10 | Unicode point U+221E INFINITY |
The markup control characters act on the following single character or
bracketed clause. The bracketed clause may contain a string of characters with
no additional markup, e.g. 2^
{10}, or it may contain additional markup that
changes font properties. Font specifiers MUST be preceded by a '/' character
that immediately follows the opening '{'. If a font name contains spaces it
must be enclosed in single or double quotes.
Examples: The first example illustrates nesting one bracketed clause inside another to produce a boldface A with an italic subscript i, all in the current font. If the clause introduced by :Normal were omitted the subscript would be both italic and boldface. The second example illustrates the same markup applied to font "Times New Roman" at 20 point size.
{/:Bold A_{/:Normal{/:Italic i}}} {/"Times New Roman":Bold=20 A_{/:Normal{/:Italic i}}}
The phantom box is useful for a@^
b_c to align superscripts and subscripts
but does not work well for overwriting an accent on a letter. For the latter,
it is much better to use an encoding (e.g. iso_8859_1 or utf8) that contains
a large variety of letters with accents or other diacritical marks. See
set encoding (p. ). Since the box is non-spacing, it is sensible to put the shorter
of the subscript or superscript in the box (that is, after the @).
Space equal in length to a string can be inserted using the '&' character. Thus
'abc&{def}ghi'would produce
'abc ghi'.
The '˜ ' character causes the next character or bracketed text to be
overprinted by the following character or bracketed text. The second text
will be horizontally centered on the first. Thus '˜ a/' will result in an 'a'
with a slash through it. You can also shift the second text vertically by
preceding the second text with a number, which will define the fraction of the
current fontsize by which the text will be raised or lowered. In this case
the number and text must be enclosed in brackets because more than one
character is necessary. If the overprinted text begins with a number, put a
space between the vertical offset and the text ('˜ {abc}{.5 000}'); otherwise
no space is needed ('˜ {abc}{.5 — }'). You can change the font for one or
both strings ('˜ a{.5 /*.2 o}' — an 'a' with a one-fifth-size 'o' on top — and
the space between the number and the slash is necessary), but you can't
change it after the beginning of the string. Neither can you use any other
special syntax within either string. You can, of course, use control
characters by escaping them (see below), such as '˜ a{2#2^
}'
You can escape control characters using 2#2, e.g., 2#22#2, 2#2{, and so on. See escape sequences (p. ) below.
Note that strings in double-quotes are parsed differently than those enclosed in single-quotes. The major difference is that backslashes may need to be doubled when in double-quoted strings.
The file "ps_guide.ps" in the /docs/psdoc subdirectory of the gnuplot source distribution contains more examples of the enhanced syntax, as does the demo http://www.gnuplot.info/demo/enhanced_utf8.htmlenhanced_utf8.dem