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.
as_widget(self)
Section titled “as_widget(self)”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.
close(self)
Section titled “close(self)”Release the browser figure and its event handlers.
off(self, event, callback)
Section titled “off(self, event, callback)”Remove a registered Python event callback.
on(self, event, callback)
Section titled “on(self, 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.
relayout(self, **layout)
Section titled “relayout(self, **layout)”Change Plotly layout fields in the live figure.
restyle(self, update, traces=None)
Section titled “restyle(self, update, traces=None)”Change trace styles by zero-based trace index in the live figure.
save(self, filename, *, scale=2)
Section titled “save(self, filename, *, scale=2)”Write HTML locally, or download PNG, SVG, JPEG, or WebP through the browser.
set(self, **options)
Section titled “set(self, **options)”Set title, broadening, sticks, dimensions, layout, or config.
to_dict(self)
Section titled “to_dict(self)”Return an independent JSON-compatible copy of the plot specification.
to_html(self, *, full_document=False)
Section titled “to_html(self, *, full_document=False)”Return an interactive HTML figure that loads the shared plot renderer.
to_json(self, *, indent=2)
Section titled “to_json(self, *, indent=2)”Return the widget specification as JSON.
to_spec(self)
Section titled “to_spec(self)”Return a plain dict for native mounting: spec, recorded commands, summary.
update(self, content)
Section titled “update(self, content)”Replace the plot data and keep the mounted widget.
write_html(self, filename)
Section titled “write_html(self, filename)”Write a standalone interactive HTML page to the local filesystem.
write_spec(self, path)
Section titled “write_spec(self, path)”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.
vibration(frequencies, **options)
Section titled “vibration(frequencies, **options)”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.
thermochemistry(result, **options)
Section titled “thermochemistry(result, **options)”Plot G(T) or F(T) from a thermochemistry temperature sweep.
charges(values, **options)
Section titled “charges(values, **options)”Plot atomic charges in elementary-charge units, using zero-based atom indices.
bond_orders(pairs, **options)
Section titled “bond_orders(pairs, **options)”Plot bond orders from zero-based i, j, order records or a pairs artifact.
magmoms(moments, **options)
Section titled “magmoms(moments, **options)”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.
scatter(x, y, **options)
Section titled “scatter(x, y, **options)”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.
heatmap(z, *, x=None, y=None, **options)
Section titled “heatmap(z, *, x=None, y=None, **options)”Plot a finite rectangular matrix as a color map.
surface(z, **options)
Section titled “surface(z, **options)”Plot a finite rectangular matrix as an interactive 3D surface.
plotly(figure, **options)
Section titled “plotly(figure, **options)”Display a Plotly figure object or a JSON-compatible Plotly specification.
band_gap(energies, n_valence)
Section titled “band_gap(energies, n_valence)”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.