Crystallography‎ > ‎Molecular graphics‎ > ‎Pymol‎ > ‎


Different label colors per object:
set label_color, colorName, object

Different label size per object:
set label_size, -0.35, pseudo1
set label_size, -0.50, pseudo2

To put res name (three letter) on the CA of the residue 306:
label (resi 306 and name CA), resn

To delete previous label:
label (resi 306 and name CA)

To insert residue ID by one letter convention as specificed at the bottom of ~/.pymolrc
label (resi 306 and name ~OD2),one_letter[resn]

The "label_position" setting specifies x,y, and z alignment of labels: values in the range [-1,1] imply alignment. Beyond that, it is a translation along camera axes in model-space dimensions.

For left alignment 0.75 A in front of atom:
set label_position, [-1,0,1.75]

For right alignment directly on atom:
set label_position, [1,0,0]

For left alignment 1 A to right of atom:
set label_position, [2,0,0]

For center alignment 2 A below atom:
set label_position, [0,-3,0]

For centered 3 A in front of atom:
set label_position, [0,0,4]

Labels for Version 0.99rc6

There are 9 different scalable fonts:
set label_font_id, number # where number is 5 through 14.

The font size can be adjusted:
set label_size, number # where number is the point size (or -number for Å).

The color can be edited:
set label_color, color-name

And to set labels:
label selection, expression

label all, name}} {{{label resi 10 , b

label 15/CA, "whatever"

To position labels, switch the mouse to edit mode, for example using:
edit_mode or clicking in the mouse setting area on the bottom right of the main windows, then use:


to position the label in space, but be careful because this way you can also move atoms.

Special characters (unicode)

To write Angstrom, which in unicode is u"\u00c5:

label 1/CA and object-name, "LSQ mean rmsd=3.3" + u"\u00c5   ".encode('utf-8')