ChimeraX docs icon

Command: 2dlabels

2dlabels  action  arguments

2dlabels fonts

The 2dlabels command allows adding 2D text and symbols to the display for presentation-quality images and movies. The labels can be of multiple colors and sizes. They exist in the X,Y plane (the plane of the screen) and do not move along with the scene. The command 2dlabels fonts lists the available fonts in the Log.

For labels that move along with the associated atoms in 3D, see the label command. See also: save, movie, making images, making movies

The action can be one of the following:

Action and argument keywords (given below) can be truncated. A vertical bar “|” designates mutually exclusive options, and default values are indicated with bold. Synonyms for true: True, 1. Synonyms for false: False, 0.

2dlabels create lab1 text 'Green Fluorescent Protein' color light sea green size 26 xpos .03 ypos .92 vis true
2dlabels change lab1 ypos .03 size 40
2dlabels delete all
2dlabels create  nametext label-contents ] [ color label-color ] [ size font-size ] [ font font-type ] [ xpos x-position ] [ ypos y-position ] [ visibility  true | false ]
The name is required and serves as an identifier for subsequently changing or deleting the 2D label. The label-contents (default nothing) 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. 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. The label-color can be any color name that specifies a single color (default white). The font-size must be an integer greater than zero (default 24). The possible values of font-type (default Arial) can be listed in the Log with the command 2dlabels fonts. Those with spaces must be enclosed in quoatation marks. The x-position and y-position are the X and Y coordinates of the lower lefthand corner of the label (defaults are 0.5 and 0.5). The X axis is horizontal and the Y axis is vertical, and both range from 0 to 1 in the visible portion of the graphics window. It is possible to place a label partially or completely outside the visible area, however. The visibility option specifies whether the label should be displayed.
2dlabels change  nametext label-contents ] [ color label-color ] [ size font-size ] [ font font-type ] [ xpos x-position ] [ ypos y-position ] [ visibility  true | false ]
The 2D label to change is specified by the name it was assigned with create, or the word all can be used to specify all 2D labels collectively. All other options are as described above for create, except the defaults are to leave the current label unchanged.
2dlabels delete  name
The 2D label to delete is specified by the name it was assigned with create, or the word all can be used to specify all 2D labels collectively.

UCSF Resource for Biocomputing, Visualization, and Informatics / July 2017