set string

This command sets attributes for strings drawn with the draw string command.


set string color <justification <thickness <rotation>>>

The color argument may be one of the 16 GrADS default colors or a new color defined with set rgb.

The justification option controls how the string is positioned with respect to the x and y positions given in the draw string command.
Refer to the diagram below for the valid options. The default justification is bl.

           tl        tc         tr          tl - top left
            + ------- + ------- +           tc - top center
            |                   |           tr - top right
            |                   |           
            |                   |           l - left
            +l        +c       r+           c - center            
            |                   |           r - right
            |                   |
            |                   |           bl - bottom left
            + ------- + ------- +           bc - bottom center
           bl         bc        br          br - bottom right

The thickness option must be an integer in the range of 1 to 12 (or 256 for version 2.1 and later.)

The rotation option specifies the desired string rotation in degrees. The center of rotation is the justification point. Rotation is counter-clockwise. Defaut rotation is 0.

Usage Notes

These two illustrations show how the letter "A" is positioned relative to each justification point; the set on the right has rotation set to 45.
string positions

These settings 'stick' until changed by issuing another set string command, or when a reset or reinit command is issued.

When using GrADS version 2.0.2 and earlier, all strings are drawn with Hershey fonts, which are drawn as collections of small line segments. For the X window display and the image output (e.g. PNG), a thickness setting between 1 and 5 will result in line segments approximately one pixel wide; a thickness between 6 and 11 will result in line segments two pixels wide, and a thickness of 12 will give line segments approximately three pixels wide. For the vector graphics output (e.g. PostScript and Encapsulated PostScript) the line segment thickness will increase with each increment in the thickness value.

If using GrADS version 2.1 and later with the Cairo graphics library enabled, and if using Hershey fonts, then each thickness setting will increment the line segment thickness, for both the X window display and for all hardcopy output formats.

The default line widths for thickness settings between 1 and 12 are: 0.6, 0.8, 1.0, 1.25, 1.5, 1.75, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0. The units (pixels or points) will depend on the surface being drawn to. In GrADS version 2.1 and later, there is a new command, set lwid, that allows the user to define a new line thickness setting if the 12 default widths are unsatisfactory.

Strings drawn with Cairo fonts will not be affected by the thickness setting in the set string command. Please read the documentation page on Font Control in GrADS for more information.


set string 1 tl 1 0
set string 1 c 6 45