Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
ASSYST documentation
ASSYST documentation

Contents:

  • Home
  • Installation
  • Background
  • Specifying Compositions
  • Filtering Structures
  • Notebooks
    • Crystal Generation
    • A Complete Workflow for a Single Element
    • Fitting a Linear ACE Potential
    • Relaxation Settings
    • Perturbations
    • Plot Gallery
    • UUIDs and Lineage Tracking

Developer Notes:

  • Metadata
    • Lineage Tracking
  • Custom Relaxers

API Reference:

  • assyst
    • assyst.crystals
    • assyst.relaxations
    • assyst.perturbations
    • assyst.filters
    • assyst.calculators
    • assyst.plot
Back to top
View this page

Plot Gallery¶

A reference notebook of every plotting helper in assyst.plot. It loads a small pre-generated Cu–Zn dataset (~1300 structures) so each example runs in a second or two — feel free to swap in your own list of ase.Atoms.

The plots below are grouped into four families:

  • Overview — every plot at a glance,

  • Structural — cell-related quantities (volume, lattice parameters, angles, aspect ratios, sizes),

  • Composition — element concentrations,

  • Distances / neighbours — bond distances and radial distributions,

  • Energy — energy histograms and energy-vs-X scatter/hexbin plots.

Each example also notes the most useful keyword arguments.

Setup¶

import pickle
import matplotlib.pyplot as plt
import assyst.plot as aplot

with open("data/plot_gallery.pkl", "rb") as f:
    structures = pickle.load(f)

print(f"Loaded {len(structures)} structures")
Loaded 1345 structures

Overview¶

Every plot at default settings, side by side.

fig = plt.figure(figsize=(15, 12))

plots = [
    ('volume_histogram',            aplot.volume_histogram),
    ('size_histogram',              aplot.size_histogram),
    ('concentration_histogram',     aplot.concentration_histogram),
    ('lattice_parameter_histogram', aplot.lattice_parameter_histogram),
    ('lattice_angle_histogram',     aplot.lattice_angle_histogram),
    ('aspect_ratio_histogram',      aplot.aspect_ratio_histogram),
    ('distance_histogram',          aplot.distance_histogram),
    ('radial_distribution',         aplot.radial_distribution),
    ('energy_histogram',            aplot.energy_histogram),
    ('energy_distance',             aplot.energy_distance),
    ('energy_volume',               aplot.energy_volume),
]

for i, (name, fn) in enumerate(plots, start=1):
    plt.subplot(4, 3, i)
    plt.title(name)
    fn(structures)

plt.tight_layout()
../_images/20400080b1149bbb73a77d9d3676eef398d20a63b231522e0333fd25167b7923.png

Structural¶

volume_histogram¶

Per-atom cell volume. bins controls resolution, density=True normalises to a probability density, color picks the bar colour.

aplot.volume_histogram(structures, bins=50, color='steelblue', density=True);
../_images/f7e9606f0e38b9a821369b7be7bf5cef1a8e6d9bd913407f20a2721ea4e6e570.png

size_histogram¶

Number of atoms per structure. rwidth adds a gap between bars; useful when bins align to integer counts.

aplot.size_histogram(structures, bins=20, color='tomato', rwidth=0.8);
../_images/9ddcb6b7c8c2f432487c3ebe454c44c14a0883ee1bd42f8f334fd213ea0c6395.png

lattice_parameter_histogram¶

Lattice parameters $a$, $b$, $c$ overlaid in one panel. kde=True adds a kernel-density estimate; alpha tames overlap between the three series.

aplot.lattice_parameter_histogram(structures, bins=40, kde=True, alpha=0.5);
../_images/4585e83be5a3f5e18a868b83180f0991f5066ff262f1010d89dad382ef724ed0.png

lattice_angle_histogram¶

Lattice angles $\alpha$, $\beta$, $\gamma$. kde=True is especially helpful here — angles cluster sharply near 90°.

aplot.lattice_angle_histogram(structures, bins=40, kde=True, alpha=0.5);
../_images/2462b081ee5a269225a8a08d67da16ee42bd8cf84847494d7a6274d328469878.png

aspect_ratio_histogram¶

Ratio of longest to shortest lattice vector — a quick check for very elongated cells. histtype='step' draws an unfilled outline; useful when overlaying multiple datasets.

aplot.aspect_ratio_histogram(structures, bins=40, color='mediumseagreen', histtype='step', linewidth=2);
../_images/a5a5d5492404c511caa5a74609301a97d7cf928833841b17ace5fca2dc595312.png

Composition¶

concentration_histogram¶

Per-structure concentration of each element. Pass elements= to restrict which species are shown.

aplot.concentration_histogram(structures, elements=['Cu', 'Zn']);
../_images/fe745ad11190d2df3d6318c2251da8921b0417616c0f50015081a36ff63213c8.png
aplot.concentration_histogram(structures, elements=['Cu']);
../_images/907f81efb2533d4350b0bb3ce6919c54937f0a0b1fe1ea5be93979d4be2b2886.png

Distances and neighbours¶

distance_histogram¶

Per-structure neighbour-distance summary. By default the minimum neighbour distance per structure is binned; pass reduce='mean' for the mean or any custom callable. rmax sets the neighbour cutoff.

aplot.distance_histogram(structures, rmax=5.0, reduce='mean', bins=60, color='slateblue');
../_images/c4cac724c9cf5702aeadc561b05fb11ccd3d71ce642757529634d11391e1d9c2.png

radial_distribution¶

All neighbour distances pooled together and weighted by 1/(4πr²) — useful for spotting preferred bond lengths. Increase rmax and bins together for finer resolution at larger distances.

aplot.radial_distribution(structures, rmax=7.0, bins=120, color='darkorange');
../_images/762c6dddccde20ae1f31aee4970779e212b5ad13806358e2a0dcf484afbc8d8a.png

Energy¶

All energy plots require an attached calculator (e.g. a SinglePointCalculator from a relaxation or an ASE calculator). Use density=True when comparing datasets of different sizes.

energy_histogram¶

Energy per atom. density=True normalises to a probability density; log=True switches the y-axis to log scale, which is useful when a handful of high-energy outliers would otherwise compress the main peak.

aplot.energy_histogram(structures, bins=60, color='crimson', density=True);
../_images/74f7db01cf0d8e18b375dbcfa30349fc5954d1951df133c305d59c0ee535b0ab.png
aplot.energy_histogram(structures, bins=60, color='crimson', log=True);

energy_distance¶

Energy per atom against neighbour distance. With ≥ 1000 structures the function automatically switches from a scatter to hexbin.

aplot.energy_distance(structures, reduce='mean', rmax=5.0, alpha=0.4);
../_images/6770bb4f03b4980f8309a208e7cf2f0bc41d17e27c45892029db3cff534f934b.png

energy_volume¶

Energy per atom against per-atom volume. Same hexbin behaviour for large datasets.

aplot.energy_volume(structures, alpha=0.4);
../_images/d23bd2f56b1501b49f94f711d7ea8140103b3410d4756137c5ed929b0ff310c2.png
Next
UUIDs and Lineage Tracking
Previous
Perturbations
Copyright © 2025, Max-Planck-Institute for Sustainable Materials
Made with Sphinx and @pradyunsg's Furo
On this page
  • Plot Gallery
    • Setup
    • Overview
    • Structural
      • volume_histogram
      • size_histogram
      • lattice_parameter_histogram
      • lattice_angle_histogram
      • aspect_ratio_histogram
    • Composition
      • concentration_histogram
    • Distances and neighbours
      • distance_histogram
      • radial_distribution
    • Energy
      • energy_histogram
      • energy_distance
      • energy_volume