MoleculePlot3D

MoleculePlot3D[mol]

creates a three-dimensional model of the molecule mol.

MoleculePlot3D[mol,patt]

creates a model of mol where all atoms and bonds matching the pattern patt are highlighted.

Details and Options

  • If the molecule does not have structure diagram coordinates, they will be generated automatically according to the molecule's AtomCoordinates option.
  • Possible values for patt include any atom, bond or molecular pattern as recognized by FindMoleculeSubstructure.
  • Patterns entered as Style[patt,spec]will be styled according to spec.
  • MoleculePlot3D has the same options as Graphics3D, with the following additions and changes:
  • BoxedFalsewhether to draw the bounding box
    ColorRulesAutomatica list of rules
    PlotLegendsNonelegends for highlights
    PlotThemeAutomaticoverall theme for the plot
  • Supported plot themes include:
  • "HeavyAtom"do not display hydrogens
    "BallAndStick"display atoms and bonds using Sphere and Cylinder primitives
    "Spacefilling"atoms are depicted with spheres with radius matching the van der Waals radius
    "Tubes"atoms omitted
    "Wireframe"bonds rendered as lines
  • Typical settings for PlotLegends include:
  • Noneno legend
    Automaticautomatically determine legend
    {lbl1,lbl2,}use lbl1, lbl2, as legend labels
    Placed[lspec,]specify placement for legend

Examples

open all close all

Basic Examples  (1)

Create a molecule and plot it:

In[1]:=
Click for copyable input
Out[1]=

Highlight all carbon-sulfur bonds:

In[2]:=
Click for copyable input
Out[2]=

Highlight two different patterns:

In[3]:=
Click for copyable input
Out[3]=
In[4]:=
Click for copyable input
Out[4]=

Scope  (2)

Options  (3)

Introduced in 2019
(12.0)