Volume Visualization in PyMOL

Quick Notes

  • PyMOL can render volumes as fully customizable (tranpsarency and color) volumes.
  • PyMOL can also render volume-based iso-surfaces.
  • Color ramp usage:
    • Click to add a point
    • Click on a point to edit that point
    • Middle-click on a point to remove it
    • Shift-click on a point to remove it (Mac- and one-button-mouse-friendly)
    • Control-click to add an iso-contour
    • Drag to manually adjust points’ value and opacity
    • Once the color chooser appears, you can enter exact values and the bottom if you please
  • Useful settings:
    • set volume_data_range, 0.5 # prune the data range MIN/MAX to be -/+ 0.5 SD
    • set volume_layers, 1024 # add more layers; slower but cleaner rendering
    • set volume_layers, 64 # fewer layers, uglier, but faster
  • MacPyOML Users (before 1.7.2): This functionality is only available in the PyMOLX11Hybrid version of MacPyMOL. Please rename the downloaded “MacPyMOL.app” to “PyMOLX11Hybrid.app” to enable this functionality.



  • New in PyMOL 1.7.2: pre-integrated volume rendering (volume_mode=1)
  • Volumes work on openGL 2.0 or older video cards
  • Volumes do not work using software renderers, eg. running 32-bit PyMOL on a 64-bit machine, or possibly across the network, and in some VMs.
  • To ray trace the volume, please type, set ray_volume, 1 before ray tracing.

Quick Links

1.7.2 Updates

Pre-Integrated Rendering

Pre-integrated volume rendering is the new default in Incentive PyMOL 1.7.2. It reduces layering artefacts significantly which are often seen on steep color gradients and/or a low number of volume_layers. It comes at a slightly higher computation cost.

Rainbow colored volume with volume_layers=100
volume_mode=0 volume_mode=1
post-classified pre-integrated

Scripting Volume Color Ramps

It’s now possible to put custom color ramps into a script or your pymolrc to be used as a named coloring preset. Example:

# example data
fetch 1ubq, type=2fofc, async=0

# register a new ramp named "blue1yellow2"
volume_ramp_new blue1yellow2, \
    1.0 blue 0.3 \
    2.0 yellow 0.2

# use the ramp with the "volume" command
volume myvol, 1ubq_2fofc, blue1yellow2

The named color ramp will also show up in the “Action > volume > ...” menu of map objects, and in the “Color > ...” menu of volume objects.

Adjusting volume colors is easiest done with the interactive volume panel (”Color > panel” in the menu of volume objects). After fine-tuning, you can get the color ramp script with the volume_color command, for re-use like in the example above:

PyMOL>volume_color myvol
### cut below here and paste into script ###
cmd.volume_ramp_new('ramp863', [\
    1.00, 0.00, 0.00, 1.00, 0.30, \
    2.00, 1.00, 1.00, 0.00, 0.20, \
    3.31, 1.00, 0.15, 0.98, 0.00, \
### cut above here and paste into script ###

The script dump will assign a random name (”ramp863” in the example above).

Copyright © Schrödinger, LLC. All Rights Reserved.