Skip to content

atomli.visualize.plot

Generated from the public Python surface of Atomli 0.1.18.

Interactive scientific plots for notebooks and standalone HTML pages.

Plot inputs use angstrom, electronvolt, and femtosecond where applicable. Vibrational wavenumbers use cm⁻¹. Phonon inputs also use cm⁻¹. The shared Tako renderer displays phonon frequencies in THz.

Plot(kind: 'str', content: 'Mapping[str, Any]', *, title=None, height=360, width='100%', broadening=None, sticks=True, layout=None, config=None, script_url='https://tako.atom.li/embed/tako-plot.js', widget=False)

Section titled “Plot(kind: 'str', content: 'Mapping[str, Any]', *, title=None, height=360, width='100%', broadening=None, sticks=True, layout=None, config=None, script_url='https://tako.atom.li/embed/tako-plot.js', widget=False)”

An interactive plot with hover values, legends, and image export.

Display the object in a trusted notebook, or call write_html. update replaces data in the existing figure. set changes the title, layout, broadening, or stick display.

Return an anywidget view with Python callbacks and direct image capture.

Install atomli[visualization] to use this interface. The ordinary HTML display does not require anywidget.

capture_png(self, filename=None, *, dpi=400, timeout=30)

Section titled “capture_png(self, filename=None, *, dpi=400, timeout=30)”

Capture a connected widget as PNG bytes, with optional local file output.

Display as_widget() before awaiting this method. A timeout reports a missing or disconnected browser view.

Release the browser figure and its event handlers.

Remove a registered Python event callback.

Register a Python callback for a live widget event.

Display as_widget() to connect the notebook kernel. Structure events include select, camera, frame, ready, and error. Plot events include click, hover, relayout, ready, and error.

Change Plotly layout fields in the live figure.

Change trace styles by zero-based trace index in the live figure.

Write HTML locally, or download PNG, SVG, JPEG, or WebP through the browser.

Set title, broadening, sticks, dimensions, layout, or config.

Return an independent JSON-compatible copy of the plot specification.

Return an interactive HTML figure that loads the shared plot renderer.

Return the widget specification as JSON.

Return a plain dict for native mounting: spec, recorded commands, summary.

Replace the plot data and keep the mounted widget.

Write a standalone interactive HTML page to the local filesystem.

Write to_spec() as JSON and return its Path.

ir(frequencies, intensities=None, **options)

Section titled “ir(frequencies, intensities=None, **options)”

Plot IR wavenumbers in cm⁻¹, from high to low, with relative intensities.

raman(frequencies, activities=None, **options)

Section titled “raman(frequencies, activities=None, **options)”

Plot increasing Raman shifts in cm⁻¹ and relative Raman activities.

Plot signed mode wavenumbers in cm⁻¹ with equal mode weights.

uv_vis(energies, intensities=None, *, states=None, references=None, sigma=None, **options)

Section titled “uv_vis(energies, intensities=None, *, states=None, references=None, sigma=None, **options)”

Plot increasing photon energies in eV and a folded absorption spectrum.

Pass a calculation artifact, or arrays of energy and intensity. states contains energy_ev and oscillator_strength records. Reference spectra can use energies_ev or wavelengths_nm.

dos(energies, density=None, *, fermi_energy=0, **options)

Section titled “dos(energies, density=None, *, fermi_energy=0, **options)”

Plot DOS in states/eV against energy relative to fermi_energy in eV.

pdos(energies, density=None, *, series=None, fermi_energy=0, **options)

Section titled “pdos(energies, density=None, *, series=None, fermi_energy=0, **options)”

Plot total DOS and named orbital or atom projections in states/eV.

phonon_dos(frequencies, density=None, *, unit='cm^-1', **options)

Section titled “phonon_dos(frequencies, density=None, *, unit='cm^-1', **options)”

Plot phonon DOS. Input wavenumbers use cm⁻¹; the displayed axis uses THz.

phonon_bands(path, frequencies=None, *, labels=None, label_positions=None, segments=None, dos=None, unit='cm^-1', **options)

Section titled “phonon_bands(path, frequencies=None, *, labels=None, label_positions=None, segments=None, dos=None, unit='cm^-1', **options)”

Plot phonon branches along a reciprocal-space path, with optional side DOS.

Frequencies have shape (q_points, modes), in cm⁻¹. Segments contain start and exclusive end indices to preserve path breaks.

xrd(angles, intensities=None, *, mode='debye', radiation='X-ray', wavelength=None, **options)

Section titled “xrd(angles, intensities=None, *, mode='debye', radiation='X-ray', wavelength=None, **options)”

Plot two-theta in degrees. Periodic data use sticks; Debye data use a line.

reaction_profile(energies, coordinate=None, **options)

Section titled “reaction_profile(energies, coordinate=None, **options)”

Plot energies in eV relative to the first reaction image.

rdf(r, values=None, *, coordination=None, **options)

Section titled “rdf(r, values=None, *, coordination=None, **options)”

Plot radial distribution against distance in angstrom, with optional coordination.

Plot G(T) or F(T) from a thermochemistry temperature sweep.

Plot atomic charges in elementary-charge units, using zero-based atom indices.

Plot bond orders from zero-based i, j, order records or a pairs artifact.

Plot atom magnetic moments in Bohr magnetons.

line(x, y=None, *, x_label='x', y_label='y', **options)

Section titled “line(x, y=None, *, x_label='x', y_label='y', **options)”

Plot paired finite arrays as a connected line.

Plot paired finite arrays as markers.

bar(x, y, *, x_label='x', y_label='y', **options)

Section titled “bar(x, y, *, x_label='x', y_label='y', **options)”

Plot paired finite arrays as bars.

Plot a finite rectangular matrix as a color map.

Plot a finite rectangular matrix as an interactive 3D surface.

Display a Plotly figure object or a JSON-compatible Plotly specification.

Band edges among the sampled k points of energies (k points, bands), in eV.

The first n_valence bands are occupied. Returns a dict with the valence-band maximum, conduction-band minimum, their k-point indices, the fundamental gap, direct (same k point) and the smallest vertical gap with its index.

band_structure(path, energies, *, n_valence, labels=None, label_positions=None, dos=None, window=None, bands_shown=None, gap_label=None, **options)

Section titled “band_structure(path, energies, *, n_valence, labels=None, label_positions=None, dos=None, window=None, bands_shown=None, gap_label=None, **options)”

Plot bands along a k path against the valence-band maximum, with the gap marked.

path holds one position per sampled k point, energies has shape (k points, bands) in eV and the first n_valence bands are occupied. Every energy is drawn as a marker at its own k point and joined by lines: nothing is interpolated. Energies are shifted so the sampled valence-band maximum is zero; the shaded interval is the fundamental gap between the sampled valence-band maximum and conduction-band minimum, marked with a square and a diamond. dos is an optional (energies_ev, density) pair on the same absolute scale, drawn in a right-hand panel that shares the energy axis. window is the displayed (low, high) in eV relative to the maximum; bands_shown limits the (valence, conduction) bands drawn.