<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pymol.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jwm</id>
	<title>PyMOL Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pymol.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jwm"/>
	<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php/Special:Contributions/Jwm"/>
	<updated>2026-09-13T14:39:03Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Label&amp;diff=13816</id>
		<title>Label</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Label&amp;diff=13816"/>
		<updated>2006-04-07T11:30:40Z</updated>

		<summary type="html">&lt;p&gt;Jwm: /* Labels Using Three Letter Abbreviations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Label_pre.png|thumb|PyMol Labels]]&lt;br /&gt;
===DESCRIPTION===&lt;br /&gt;
'''label''' labels one or more atoms properties over a selection using the python evaluator with a separate name space for each atom.  The symbols defined in the name space are:&lt;br /&gt;
*name&lt;br /&gt;
*resn&lt;br /&gt;
*resi&lt;br /&gt;
*chain&lt;br /&gt;
*q&lt;br /&gt;
*b&lt;br /&gt;
*segi&lt;br /&gt;
*type (ATOM,HETATM) &lt;br /&gt;
*formal_charge&lt;br /&gt;
*partial_charge&lt;br /&gt;
*numeric_type&lt;br /&gt;
*text_type &lt;br /&gt;
&lt;br /&gt;
All strings in the expression must be explicitly quoted.  This operation typically takes several seconds per thousand atoms altered.  To clear labels, simply omit the expression or set it to ''.&lt;br /&gt;
&lt;br /&gt;
===USAGE===&lt;br /&gt;
 label (selection),expression&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===SETTINGS===&lt;br /&gt;
====FONT====&lt;br /&gt;
There are 9 different scalable fonts.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;set label_font_id, number&amp;lt;/source&amp;gt;&lt;br /&gt;
where number is 5 through 14.&lt;br /&gt;
=====UTF8 Fonts=====&lt;br /&gt;
&lt;br /&gt;
[[Image:New_fonts.jpeg|thumb|New fonts in PyMol.  Notice the alpha and beta characters.]]&lt;br /&gt;
&lt;br /&gt;
Newer versions support UTF8 fonts; use '''font_label_id''' from above to 15 or 16.  The good news about the UTF8 fonts is that they support the alpha and beta characters. (See iamge.)&lt;br /&gt;
&lt;br /&gt;
Here's some example code for the image at right:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# roman&lt;br /&gt;
set label_font_id, 15&lt;br /&gt;
label 5/CA, &amp;quot;\316\261-Helix&amp;quot;&lt;br /&gt;
label 10/CA, &amp;quot;\316\262-Sheet&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# italic&lt;br /&gt;
set label_font_id, 16&lt;br /&gt;
&lt;br /&gt;
# make bigger&lt;br /&gt;
set label_size, 50&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====SIZE====&lt;br /&gt;
The font size can be adjusted&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;set label_size, number&amp;lt;/source&amp;gt;&lt;br /&gt;
where number is the point size (or -number for Angstroms)&lt;br /&gt;
&lt;br /&gt;
====COLOR====&lt;br /&gt;
Set a label's color by&lt;br /&gt;
 set label_color, color&lt;br /&gt;
where color is a valid PyMol color.&lt;br /&gt;
&lt;br /&gt;
====EXPRESSION====&lt;br /&gt;
To set what the label reads (see above)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;label selection, expression&amp;lt;/source&amp;gt;&lt;br /&gt;
For example&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
 label all, name&lt;br /&gt;
 label resi 10, b&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====POSITION====&lt;br /&gt;
To position labels&lt;br /&gt;
 edit_mode&lt;br /&gt;
then&lt;br /&gt;
ctrl-middle-click-and-drag to position the label in space.&lt;br /&gt;
&lt;br /&gt;
===EXAMPLES===&lt;br /&gt;
 label (chain A),chain&lt;br /&gt;
 label (n;ca),&amp;quot;%s-%s&amp;quot; % (resn,resi)&lt;br /&gt;
 label (resi 200),&amp;quot;%1.3f&amp;quot; % partial_charge&lt;br /&gt;
&lt;br /&gt;
The following image was created with&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
label (resi 200),&amp;quot;%1.3f&amp;quot; % b&lt;br /&gt;
set label_font_id, 10&lt;br /&gt;
set label_size, 10&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
and finally, some labels were moved around in '''edit_mode'''.&lt;br /&gt;
[[Image:Label_ex.png|thumb|Labels.]]&lt;br /&gt;
&lt;br /&gt;
===Users Comments===&lt;br /&gt;
====Labels Using ID Numbers====&lt;br /&gt;
The following commnent,&lt;br /&gt;
 label SELECTION, &amp;quot; %s&amp;quot; % ID &lt;br /&gt;
labels the SELECTION with atom ID numbers.&lt;br /&gt;
&lt;br /&gt;
You can make more complicated selections/lables such as&lt;br /&gt;
 label SELECTION, &amp;quot; %s:%s %s&amp;quot; % (resi, resn, name)&lt;br /&gt;
which will give you something like &amp;quot;GLU:139 CG&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====Labels Using One Letter Abbreviations====&lt;br /&gt;
* First, Add this to your $HOME/.pymolrc  file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# start $HOME/.pymolrc modification&lt;br /&gt;
one_letter ={'VAL':'V', 'ILE':'I', 'LEU':'L', 'GLU':'E', 'GLN':'Q', \&lt;br /&gt;
'ASP':'D', 'ASN':'N', 'HIS':'H', 'TRP':'W', 'PHE':'F', 'TYR':'Y',    \&lt;br /&gt;
'ARG':'R', 'LYS':'K', 'SER':'S', 'THR':'T', 'MET':'M', 'ALA':'A',    \&lt;br /&gt;
'GLY':'G', 'PRO':'P', 'CYS':'C'}&lt;br /&gt;
# end modification&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*. Second, instead of:&lt;br /&gt;
 label n. ca, resn&lt;br /&gt;
use:&lt;br /&gt;
 label n. ca, one_letter[resn]&lt;br /&gt;
&lt;br /&gt;
[[Category:Commands|label]]&lt;/div&gt;</summary>
		<author><name>Jwm</name></author>
	</entry>
</feed>