Talk:Label

From PyMOLWiki
Jump to navigation Jump to search

Fixes

  • Updates needed

New Page Content

New Page Overview

This is the content for the new labels page.

Overview

The Label command controls how PyMOL draws text labels for PyMOL objects. Labeling is important so there are many options for your fine tuning needs. You can change the label size, label color, positioning, font, the label outline color that masks the font and much, much more.

You can have PyMOL label atoms by properties or arbitrary strings as you want; you can even use Unicode fonts for special symbols like, , etc.

The following gallery shows some examples of how extensible the Label command is.

Object Properties

Aside from arbitrary string labels, like "This is the catalytic residue" for an atom/residue you can also use the following built-in molecular properties:

  • name, the atom name
  • resn, the residue name
  • resi, the residue number/identifier
  • chain, the chain name
  • q, charge
  • b, the occupancy/b-factor
  • segi, the segment identifier
  • type (ATOM,HETATM), the type of atom
  • formal_charge, the formal charge
  • partial_charge, the partial charge
  • numeric_type, the numeric type
  • text_type, the text type

Syntax

To use the label command follow this syntax:

# labeling syntax
label [ selection[, expression]]

where selection is some object/selection you want to label and expression is some string (or set of strings) which PyMOL is to use to label the given selection.

We have plenty of examples. See the examples below.

Settings

Here are all the label settings and their general effect. For each label setting, see the respective web page for more details.

label_angle_digits

(no idea)

label_distance_digits

(no idea)

label_shadow_mode

sets whether or not PyMOL will ray trace shadows for your label text. Eg:
set label_shadow_mode, 2

label_color

sets the color of the label text. Eg:
set label_color, magenta

label_font_id

sets the font to render your label. Eg:
set label_font_id, 12

label_size

sets the size of the text. Eg:
set label_size, -2

label_digits

(no idea)

label_outline_color

each label is outlined (so you can do white-on-white labels, for example). This options sets the color of the label outline. Eg.
set label_outline_color, orange

label_dihedral_digits

(no idea)

label_position

sets any offset from the original X,Y,Z coordinates for the label

Examples

# make a very simple label on the 14th alpha carbon.
label n. CA and i. 14, "This is carbon 14."

# make a fake scene label; use this to label entire scenes, not just atoms/bonds.
pseudoatom foo
label foo, "Once upon a time..."

# make a huge label
set label_size, -5
pseudoatom foo
label foo, "This is large text"

See Also