How to Show Protein Surfaces in PyMOL: Electrostatics, Hydrophobicity and Binding Pockets
Surface representations communicate things that cartoon ribbons can’t — the shape of a binding pocket, the electrostatic character of an interface, which patches are hydrophobic. This guide covers every surface type in PyMOL, how to color them meaningfully, and how to prepare them for publication.
Surface types — molecular, dot, mesh
PyMOL offers three distinct surface representations, each suited to different communication goals:
For the vast majority of publication figures, you’ll use show surface — the solid molecular surface. The other two are useful in specialized contexts but rarely appear in structural biology papers as primary representations.
Basic surface commands and transparency
# Show surface for all objects
show surface
# Show surface for specific selection only
show surface, chain A
# Show surface + cartoon together (classic publication style)
show cartoon
show surface
set transparency, 0.5
# Hide surface
hide surface
The most powerful surface figure style is the semi-transparent surface layered over the cartoon ribbon. The transparency lets the secondary structure show through, communicating both overall shape and internal architecture in a single image.
color slate, polymer (neutral cartoon), then set surface_color, white (white surface) with set transparency, 0.5. The white semi-transparent surface gives the shape without competing with the cartoon colors underneath.
Electrostatic surface with APBS
An electrostatic surface maps the protein’s electrostatic potential onto the molecular surface — negative regions (red) show where positively charged ligands or residues are attracted, and positive regions (blue) show where negatively charged species bind. It’s one of the most commonly requested figures in structural biology papers dealing with charged interfaces, DNA-binding proteins, and ion channels.
Generating an electrostatic surface requires the APBS plugin — available in the full Schrödinger PyMOL (educational and commercial licenses) but not in the open-source build by default. If you have the educational license:
# 1. Load and prepare the protein (no ligands, no waters)
fetch 4XYZ
remove resn HOH
remove hetatm
as surface
# 2. Run APBS from the Plugin menu:
# Plugin → APBS Tools → Run APBS → Map and color surface
# The plugin handles everything: PQR generation, APBS calculation,
# and surface coloring automatically
Manual electrostatic coloring without APBS
If you don’t have the APBS plugin, a quick approximation colors the surface by the charge character of nearby residues. This is not a true electrostatic calculation but is visually informative:
# Color surface by "charge" using built-in coloring
show surface
set surface_color, white # start from neutral white
# Select charged residues and color the nearby surface
select pos_charged, resn LYS+ARG+HIS
select neg_charged, resn ASP+GLU
color blue, pos_charged
color red, neg_charged
# For a smoother look, color only the surface atoms
# based on residue charge character
color blue, pos_charged and elem C
color red, neg_charged and elem C
Color by hydrophobicity
Hydrophobicity coloring maps each residue’s hydrophobicity score onto the surface, revealing hydrophobic patches that drive protein folding, membrane insertion, and protein-protein interactions. White typically represents neutral or hydrophilic character; orange-to-brown indicates hydrophobic patches.
# Built-in hydrophobicity spectrum coloring
show surface
spectrum hydrophobicity, white_orange, selection=polymer
# Two-tone: hydrophobic orange, hydrophilic blue
spectrum hydrophobicity, blue_white_red, selection=polymer
# Manual hydrophobicity coloring using standard residue groups
color white, polymer # start neutral
color tv_orange, resn PHE+LEU+ILE+VAL+MET+TRP+ALA # hydrophobic
color marine, resn LYS+ARG+ASP+GLU+HIS+SER+THR+ASN+GLN # hydrophilic
spectrum hydrophobicity command maps colors to the surface based on the hydrophobicity of each surface atom’s parent residue. Run show surface first, then apply the hydrophobicity spectrum. The result colors the surface itself — you don’t need to separately color the cartoon unless you want a combined surface + ribbon figure.
Showing binding pockets and cavities
Binding pocket visualization is one of the most common reasons researchers use surface representations. PyMOL doesn’t have a built-in pocket detection algorithm (use fpocket or SiteMap for that), but it excels at displaying a known pocket once you know which residues define it.
# Select pocket residues (5 Å around the ligand)
fetch 4XYZ
as cartoon
hide everything, resn HOH
select LIG, resn LIG
select pocket, byres (LIG around 5)
# Show pocket surface only (not the whole protein)
show surface, pocket
color white, pocket
set transparency, 0.3
# Show ligand as sticks over the surface
show sticks, LIG
util.cbag LIG
# Optional: show protein cartoon underneath for context
show cartoon, polymer and not pocket
color gray70, polymer and not pocket
zoom pocket
Showing internal cavities
To reveal internal cavities — channels, tunnels, or cryptic binding sites — adjust the surface probe radius. A smaller probe radius (below the default 1.4 Å) allows the surface to penetrate into smaller openings, revealing cavities that a standard probe misses:
# Smaller probe = surface dips into more cavities (shows more internal features)
set solvent_radius, 0.6
rebuild
# Use cavity_detection_gap for explicit cavity rendering
set surface_cavity_mode, 1 # show surface facing into cavities
set surface_cavity_radius, 3 # minimum cavity radius to show
Preparing surfaces for publication
-
Set surface quality to 2 or higher. The default surface quality (0) is fast but visibly faceted at publication scale. Run
set surface_quality, 2before ray tracing. Quality 1 is a good compromise; quality 3+ is extremely slow and rarely necessary. -
Turn off specular highlights on the surface. By default, PyMOL adds shiny specular highlights to surfaces. For a cleaner, more matte publication look:
set surface_type, 0andset specular, 0.2. -
Use a white background and opaque render.
bg_color whiteandset ray_opaque_background, 1before every export. Transparent PNG backgrounds look wrong in most journal layouts. -
Ray trace at appropriate resolution.
ray 1200, 900for a single-column figure. For a half-page or full-page panel, use 2000 × 2000 or larger. Always export withpng filename.png, dpi=300. -
Save the session before closing. Surface calculations and coloring are session-specific. Save with
save session.pseso you can adjust the figure without recalculating the surface from scratch.
Surface settings reference
| Setting | Default | Effect |
|---|---|---|
| surface_quality | 0 | Surface smoothness — increase to 1 or 2 for publication |
| transparency | 0.0 | Surface transparency (0=opaque, 1=invisible) |
| solvent_radius | 1.4 | Probe radius for surface calculation in ångströms |
| surface_color | (atom colors) | Force surface to a single color: set surface_color, white |
| surface_cavity_mode | 0 | Set to 1 to show cavity-facing surfaces |
| surface_cavity_radius | 5 | Minimum radius of cavities to render |
| surface_type | 0 | 0=solid, 1=dots, 2=mesh. Can switch type after surface is shown |
set defer_builds_mode, 5 to delay rebuilding surfaces during rotation.
Surfaces in one paragraph
Run show surface to add a molecular surface, then set transparency, 0.5 with show cartoon for the classic publication style that shows both shape and secondary structure. For electrostatics, use the APBS plugin if you have the educational license — or color by charged residue type as an approximation. For hydrophobicity, spectrum hydrophobicity, white_orange, selection=polymer highlights hydrophobic patches in a single command. For binding pockets, show surface, pocket on a named selection targets the surface to the region that matters. Set surface_quality, 2 before ray tracing for publication. Save your session before closing.