The label command shows labels that move along with the associated atoms, residues, bonds, or pseudobonds in 3D, with default contents: atom name, residue name and number, and bond or pseudobond length. See also: distance, 2dlabels
These “3D” (although flat in appearance) labels can be of multiple colors and sizes, and both atom and residue labels can be shown for the same atom at the same time. A label is automatically hidden, however, when the corresponding item (atom, residue, bond, or pseudobond) is hidden.
Using a blank atom-spec with the label command indicates acting on all existing 3D labels, optionally restricted with the atoms, residues, bonds, or pseudobonds keyword; if atom-spec is not blank, the default is to act on labels for atoms only. A non-blank atom-spec is required to create new labels. For label delete (regardless of whether the atom-spec is blank), the default is to act on all types of 3D labels unless narrowed with the atoms, residues, bonds, or pseudobonds keyword.
The command label listfonts lists the possible fonts in the Log.
3D labels can also be added/deleted by clicking in the graphics window (see mousemode). For adding titles and other text at fixed positions in the window for presentation-quality images and movies, see the 2dlabels command.
Parameters that are not specified retain their current values.
text label-contents | default
Text contents of the label, which can be an arbitrary string or default information based on the object type being labeled:
Arbitrary label-contents can include letters, numbers, symbols from the keyboard; additional symbols can be copied and pasted into the command line, or indicated with unicode character codes or character names. (See 2dlabels for Unicode examples.) Spaces and quote marks can be included by enclosing the entire label-contents in single or double quote marks. Carriage returns are indicated with \n.
- for atoms (default), atom name
- for residues, residue name and number
- for bonds or pseudobonds, length
color label-color | default
Label color, where label-color can be any color name that specifies a single color (default white).
size font-size | default
Label size, where font-size must be an integer greater than zero (default 24).
font font-type | default
Label font (default Arial); the command label listfonts lists the possible values of font-type in the Log. Those with spaces must be enclosed in quotation marks.
offset x,y,z | default
An absolute offset is specified by three comma-separated values x,y,z representing distances along the X-, Y-, and Z-axes in the screen coordinate system. Negative values can be given. The default offset is (display_radius + 0.2),0,0.5.
onTop true | false
Whether to draw the labels on top of other objects regardless of their relative positions in 3D (default true); applies to all 3D labels no matter which atoms are specified.