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.
  • mol can be a Molecule object or something that can be easily converted to one, such as a systematic chemical name, a "Chemical" entity or ExternalIdentifier.
  • Possible forms for patt include:
  • nthe index of a particular atom
    Atom[]a pattern for an atom
    Bond[]a pattern for a bond
    MoleculePattern[]a pattern for a molecule substructure
    {patt1,patt2,}a list of patterns
    <|label1patt1,|>an Association of labels and patterns
  • 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:
  • AtomLabelsNonelabels and label placements for atoms
    AtomLabelStyleAutomaticstyle to use for atom labels
    BondLabelsNonelabels and label placements for bonds
    BondLabelStyleAutomaticstyle to use for bond labels
    BoxedFalsewhether to draw the bounding box
    ColorRulesAutomatica list of rules
    IncludeHydrogensTruewhether to show hydrogen atoms
    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
  • When patt is entered as an Association, the labeli will be used in the PlotLegends.

Examples

open allclose all

Basic Examples  (3)

Create a molecule and plot it in 3D:

Highlight the first and third atoms:

Highlight all oxygen atoms:

Highlight two different patterns:

Use different plot themes:

Scope  (2)

A pattern can match one or multiple positions in a molecule:

Highlight each carbonyl separately:

Highlight each carbonyl as a single color:

Highlight several patterns:

Options  (7)

AtomLabels  (1)

Label all atoms by their index:

Label only chlorine atoms by their index:

Label non-hydrogen atoms by their hybridization:

AtomLabelStyle  (1)

Set all labels to have the same style:

Set the label style depending on atom type:

BondLabels  (1)

Label all bonds by their index:

Label only bonds to chlorine atoms by their bond type:

BondLabelStyle  (1)

Give all bond labels the same style:

Label bonds differently based on their atoms:

ColorRules  (1)

Specify different colors for atomic elements:

PlotLegends  (1)

Use placeholders for plot legends:

Use the expressions to label the highlights:

PlotTheme  (1)

Use different plot themes to visualize a molecule in 3D:

Wolfram Research (2019), MoleculePlot3D, Wolfram Language function, https://reference.wolfram.com/language/ref/MoleculePlot3D.html (updated 2021).

Text

Wolfram Research (2019), MoleculePlot3D, Wolfram Language function, https://reference.wolfram.com/language/ref/MoleculePlot3D.html (updated 2021).

CMS

Wolfram Language. 2019. "MoleculePlot3D." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/MoleculePlot3D.html.

APA

Wolfram Language. (2019). MoleculePlot3D. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MoleculePlot3D.html

BibTeX

@misc{reference.wolfram_2022_moleculeplot3d, author="Wolfram Research", title="{MoleculePlot3D}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/MoleculePlot3D.html}", note=[Accessed: 01-June-2023 ]}

BibLaTeX

@online{reference.wolfram_2022_moleculeplot3d, organization={Wolfram Research}, title={MoleculePlot3D}, year={2021}, url={https://reference.wolfram.com/language/ref/MoleculePlot3D.html}, note=[Accessed: 01-June-2023 ]}