MoleculePlot [mol]
creates a two-dimensional structure diagram of the molecule mol.
MoleculePlot [mol,patt]
creates a diagram of mol where all atoms and bonds matching the pattern patt are highlighted.
MoleculePlot
MoleculePlot [mol]
creates a two-dimensional structure diagram of the molecule mol.
MoleculePlot [mol,patt]
creates a diagram of mol where all atoms and bonds matching the pattern patt are highlighted.
Details and Options
- MoleculePlot returns a Graphics expression.
- If the molecule does not have structure diagram coordinates, they will be generated automatically.
- mol can be a Molecule object or something that can be easily converted to one, such as a systematic chemical name, a "Chemical" entity, a BioSequence or an ExternalIdentifier .
- MoleculePlot [MoleculePattern […]] will return a depiction of the given molecule pattern.
- Possible forms for patt include:
-
n the index of a particular atom{patt1,patt2,…} a list of patterns
- MoleculePlot has the same options as Graphics , with the following additions and changes: [List of all options]
-
ColorRules Automatic a list of rules {elem1->col1,…} dictating which colors to use for atomic elements
- Supported plot themes include:
-
"AllAtom" display all hydrogens"Aromatic" aromatic bonds are shown as dashed lines or circles"HeavyAtom" hydrogen atoms are elided or combined with the connected heavy atom"Monochrome" all text and graphics are shown in black
- Typical settings for PlotLegends include:
-
None no legendAutomatic automatically determine legend{lbl1,lbl2,…} use lbl1, lbl2, … as legend labels
-
ColorRules Automatic a list of rules {elem1->col1,…} dictating which colors to use for atomic elementsImageMargins 0. the margins to leave around the graphicPreserveImageOptions Automatic whether to preserve image options when displaying new versions of the same graphic
List of all options
Examples
open all close allBasic Examples (2)
Create a molecule and plot it:
Highlight the first and third atoms:
Highlight all oxygen atoms:
Highlight two different patterns:
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)
By default, aromatic bonds are shown in their delocalized Kekule form. Use the "Aromatic" plot theme to show which bonds are aromatic. Phenyl rings are shown with a circle to indicate the delocalized bonding electrons. Aromatic heterocycles use dashed lines for aromatic bonds:
Combine different plot themes:
See Also
MoleculePlot3D Molecule MoleculeRecognize AtomLabels AtomLabelStyle BondLabels BondLabelStyle
Entity Types: Chemical Protein
Function Repository: MoleculeValuePlot SmilesPlot BioSequenceMoleculePlot
Related Guides
Text
Wolfram Research (2019), MoleculePlot, Wolfram Language function, https://reference.wolfram.com/language/ref/MoleculePlot.html (updated 2021).
CMS
Wolfram Language. 2019. "MoleculePlot." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/MoleculePlot.html.
APA
Wolfram Language. (2019). MoleculePlot. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MoleculePlot.html
BibTeX
@misc{reference.wolfram_2025_moleculeplot, author="Wolfram Research", title="{MoleculePlot}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/MoleculePlot.html}", note=[Accessed: 17-November-2025]}
BibLaTeX
@online{reference.wolfram_2025_moleculeplot, organization={Wolfram Research}, title={MoleculePlot}, year={2021}, url={https://reference.wolfram.com/language/ref/MoleculePlot.html}, note=[Accessed: 17-November-2025]}