Plotting API Reference#
Module: chemparseplot.plot.neb#
Data Structures#
InsetImagePos#
Frozen dataclass for inset structure image placement with fields x, y, and rad.
Field |
Type |
Description |
|---|---|---|
|
|
Data x coordinate |
|
|
Data y coordinate |
|
|
Arrow curvature radius |
SmoothingParams#
Dataclass for Savitzky-Golay smoothing of NEB force profiles.
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
Savitzky-Golay window length |
|
|
|
Polynomial order |
1D Profile Functions#
plot_energy_path#
plot_energy_path(
ax, rc, energy, f_para, color, alpha, zorder,
method="hermite", smoothing=None, label=None, *,
markersize=None, markeredgewidth=None, markeredgecolor=None, samples=None,
)
Plots a 1D energy profile with optional Hermite spline interpolation.
Parameters#
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
Target axes |
|
|
|
Reaction coordinate (RMSD or image index) |
|
|
|
Energy values |
|
|
|
Parallel force component |
|
|
|
Line and marker color |
|
|
|
Opacity |
|
|
|
Drawing order |
|
|
|
|
Interpolation method: |
|
|
|
Savitzky-Golay parameters (defaults to |
|
|
|
Legend label of the curve |
|
|
|
Image marker size in points; |
|
|
|
Marker edge width in points; |
|
colour or |
|
Marker edge colour; the line colour when |
|
|
|
Points on the interpolant; when |
Notes#
hermite: CubicHermiteSpline using Savitzky-Golay smoothed force derivatives. Produces physically meaningful interpolation when forces are available.spline: Standard B-spline viasplrep/splev(cubic, k=3). Does not use force information.none: markers joined by straight segments.Normalizes reaction coordinate to [0, 1] before fitting, then maps back.
Falls back to raw line plot if spline fitting raises an exception.
Marker size and edge width follow the rcParams, which
chemparseplot.plot.journal.apply_stylesets. Before 1.14.0 they were fixed at 6 and 0.5 points.With
samplesleft atNonethe curve has a point for every pixel column atsavefig.dpi.apply_stylesets that to the journal’s line-art resolution, so the count matchesplot_neb_profile. Before 1.14.0 the curve always had 300 points.
plot_neb_profile#
plot_neb_profile(
rc, energy, f_para=None, *, history=None, iterations=None,
reference=None, reference_label="Reference", ax=None, journal=None,
columns="single", method="hermite", smoothing=None, color=None,
label=None, energy_unit="eV", xlabel="Path length (\u00c5)", ylabel=None,
barrier=True,
)
Nudged elastic band (NEB) energy profile in the journal style. Returns the figure.
Parameters#
All but rc and energy have defaults:
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
Path length (or other reaction coordinate) of each image |
|
|
|
Energy of each image |
|
|
|
|
Force along the path, the negative of the Hermite curve’s slope |
|
sequence or |
|
Earlier bands, oldest first, each |
|
sequence of |
|
Iteration of each earlier band, counted from 0 when |
|
|
|
Energy drawn as a dashed, directly labelled line |
|
|
|
Label of the reference line |
|
|
|
Panel to draw into; a new figure when |
|
|
|
Journal style ( |
|
|
|
Column span of a new figure |
|
|
|
|
|
|
|
Savitzky-Golay filter on the forces; raw forces when |
|
colour or |
|
Band colour (teal when |
|
|
|
Band label, written at the end of the band |
|
|
|
Unit in the energy label and barrier |
|
|
path length, relative energy |
x and y labels |
|
|
|
Barrier written above the highest interior image |
Notes#
The band is a wide line through markers outlined in the background colour. The curve is sampled once per output pixel at the journal’s raster resolution.
Earlier bands are narrow lines coloured light to dark along the entries of
ruhi_seqthat reach 3:1 on the background. A colour bar gives their iterations.The barrier is the highest image above the first. It is written with one decimal more than the energy ticks show, on a halo of the background colour.
Without
axthe journal style goes into the global rcParams, asjournal_figuredoes. Withaxthe caller’s rcParams are kept and the journal sets only line and marker sizes.
plot_eigenvalue_path#
plot_eigenvalue_path(ax, rc, eigenvalue, color, alpha, zorder, grid_color="white")
Plots a 1D eigenvalue profile with cubic spline interpolation.
Parameters#
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
Target axes |
|
|
|
Reaction coordinate |
|
|
|
Eigenvalue array |
|
|
|
Line and marker color |
|
|
|
Opacity |
|
|
|
Drawing order |
|
|
|
|
Color of the horizontal zero-line |
Notes#
Adds a horizontal dashed line at eigenvalue = 0
Uses square markers (
"s")
2D Landscape Functions#
plot_landscape_surface(...)#
Plots a 2D landscape surface using gradient-enhanced GP/RBF interpolation.
The signature below shows the core arguments only.
plot_landscape_surface(
ax, rmsd_r, rmsd_p, grad_r, grad_p, z_data,
step_data=None, method="grad_matern", rbf_smooth=None,
cmap="ruhi_diverging", show_pts=True, variance_threshold=0.05,
project_path=True, extra_points=None, n_inducing=None,
xlim=None, ylim=None, basis=None,
auto_thin=False, max_surface_points=64,
surface_fit=None,
show_variance_contours=True, fade_distance_above=None,
)
Parameters#
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
Target axes |
|
|
|
RMSD from reactant |
|
|
|
RMSD from product |
|
|
|
Synthetic gradient (R direction) |
|
|
|
Synthetic gradient (P direction) |
|
|
|
Energy or eigenvalue |
|
|
|
|
Step indices per point |
|
|
|
Surface model (see table below) |
|
|
|
Length scale hint (auto-optimized) |
|
|
|
Matplotlib colormap name |
|
|
|
Scatter data points on surface |
|
|
|
Variance contour threshold (fraction of range) |
|
|
|
Project to reaction valley coordinates |
|
|
|
Shape |
|
|
|
Inducing points for Nystrom approximation |
|
|
|
Opt-in: subsample dense clouds for the fit only |
|
|
|
Cap when |
|
|
|
TOML-friendly config; overrides the two keys above when set |
|
|
|
Draw the dashed predictive-variance contours |
|
|
|
Fade cells farther than this distance from every observation |
SurfaceFitConfig (v1.9.10+)#
Prefer a small config object over growing kwargs. Key names match rgpycrumbs
eOn plot TOML (auto_thin, max_surface_points):
from chemparseplot.plot.neb import SurfaceFitConfig, plot_landscape_surface
cfg = SurfaceFitConfig.from_mapping({"auto_thin": True, "max_surface_points": 64})
# or: SurfaceFitConfig(auto_thin=True, max_surface_points=64)
plot_landscape_surface(
ax, rmsd_r, rmsd_p, grad_r, grad_p, z_data,
method="grad_imq",
surface_fit=cfg,
)
Defaults keep historical behaviour (~auto_thin=False=).
Interpolation Methods#
Method |
Description |
|---|---|
|
Gradient-enhanced Matern kernel (default) |
|
Gradient-enhanced Inverse MultiQuadric |
|
Nystrom-approximated |
|
Value-only RBF (no gradients) |
Notes#
Hyperparameters (length scale, noise) optimized on the latest step’s data only
Variance contours drawn at 5%,
variance_threshold, and 95% of the rangeWhen Nystrom is active, non-inducing points are drawn with reduced opacity (alpha=0.15)
Reaction valley projection rotates (RMSD-R, RMSD-P) into (progress
s, deviationd) along the R-to-P lineSurface models come from
rgpycrumbs.surfacesWith
auto_thin, the GP trains on a thinned set; scatter and viewport still use the full cloudDense force-eval movies can yield non-finite
grad_imqgrids without thinning; opt in explicitly
plot_landscape_path_overlay(ax, r, p, z, cmap, z_label, project_path=True)#
Overlays a colored NEB path line on the landscape surface.
Parameters#
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
Target axes |
|
|
|
RMSD from reactant (path images) |
|
|
|
RMSD from product (path images) |
|
|
|
Energy coloring values |
|
|
|
Colormap name |
|
|
|
Colorbar label |
|
|
|
|
Apply reaction valley projection |
Returns#
matplotlib.colorbar.Colorbar – The created colorbar instance.
Notes#
Draws a
LineCollectioncolored by the average energy of adjacent imagesScatter points with black edge at each image position
Creates and returns a colorbar
Structure Rendering Functions#
render_structure_to_image(atoms, zoom, rotation)#
Renders an ASE Atoms object to a numpy RGBA image array using ASE’s built-in PNG writer.
Parameters#
Parameter |
Type |
Description |
|---|---|---|
|
|
Structure to render |
|
|
Zoom level (used by callers for OffsetImage scaling) |
|
|
ASE rotation string, e.g. |
Returns#
np.ndarray – RGBA image array with shape (H, W, 4) and float dtype.
plot_structure_strip#
plot_structure_strip(
ax, atoms_list, labels=None, zoom=0.3, rotation="0x,90y,0z", theme_color="black",
max_cols=6, renderer="xyzrender", label_ax=None,
label_fontsize=None, label_padding_px=3.0
)
Renders a horizontal gallery of atomic structures.
Parameters#
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
Target axes (turned off) |
|
|
|
Structures to render, or typed strip entries |
|
|
|
|
Labels below each image; inferred from |
|
|
|
Image zoom level |
|
|
|
ASE rotation string |
|
|
|
Label text color |
|
|
|
Maximum columns before wrapping |
|
|
|
Structure rendering backend |
|
|
|
Optional caption-only axis aligned with the structure gallery |
|
|
|
Caption size in points; |
|
|
|
Inset in pixels from the bottom of the row; ignored when |
Notes#
Adaptive font size: shrinks for more than 4 items
Multi-row layout with
max_colswrappingxyzrenderrenderer requirespip install 'xyzrender>=0.1.3'StructurePlacementlets callers pass a typed strip payload instead of parallelatoms_list/labelslistsSupplying
label_axkeeps captions out of the structure-image axis and uses matching normalized row and column positions
plot_structure_inset#
plot_structure_inset(
ax, atoms, x, y, xybox, rad, zoom=0.4, rotation="0x,90y,0z", arrow_props=None,
renderer="ase"
)
Plots a single structure as an annotation inset with an arrow.
Parameters#
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
Target axes |
|
|
|
Structure to render |
|
|
|
Data x coordinate for arrow target |
|
|
|
Data y coordinate for arrow target |
|
|
|
Offset in points for image placement |
|
|
|
Arrow curvature ( |
|
|
|
|
Image zoom level |
|
|
|
ASE rotation string |
|
|
|
Override default arrow properties |
|
|
|
|
Notes#
Default arrow style: Fancy with
head_length=0.4,head_width=0.4,tail_width=0.1Image zorder set to 80 (above most plot elements)
OCI-NEB/RONEB Functions#
plot_mmf_peaks_overlay#
plot_mmf_peaks_overlay(ax, peak_rmsd_r, peak_rmsd_p, peak_energies, project_path=True,
path_rmsd_r=None, path_rmsd_p=None, cmap="ruhi_diverging")
Overlays MMF (mode-following) refinement peak positions on the landscape. Used for OCI-NEB/RONEB to show where dimer refinement was applied.
Parameters#
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
Target axes (same as landscape) |
|
|
|
RMSD-R coordinates of peak structures |
|
|
|
RMSD-P coordinates of peak structures |
|
|
|
Energy at each peak |
|
|
|
|
Apply reaction valley projection |
|
|
|
Colormap of the peak cores |
Notes#
Draws a dark outer halo marker below each peak and an energy-colored core on top
Colors peak cores by energy with
cmap, by default the landscape’s own map
plot_neb_evolution(ax, step_rmsd_r_list, step_rmsd_p_list, project_path=True, cmap=None)#
Shows NEB band evolution across optimization iterations with fading older bands.
Parameters#
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
Target axes |
|
|
|
RMSD-R arrays per NEB iteration |
|
|
|
RMSD-P arrays per NEB iteration |
|
|
|
|
Apply reaction valley projection |
|
|
|
Colormap for band fading; when |
High-Level ORCA Functions#
plot_orca_neb_profile(neb_data, output, *, width=7.0, height=5.0, dpi=200)#
Simple ORCA NEB energy profile. Plots image index vs energy with labeled reactant, product, and saddle.
Parameters#
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
Typed result from |
|
|
|
Output file path |
|
|
|
|
Figure width (inches) |
|
|
|
Figure height (inches) |
|
|
|
Output resolution |
plot_orca_neb_energy_profile#
plot_orca_neb_energy_profile(
neb_data, output, *, width=5.37, height=5.37, dpi=200, method="hermite",
smoothing=None
)
Publication ORCA NEB energy profile using the eOn-style plot_energy_path() function.
Parameters#
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
Typed result from |
|
|
|
Output file path |
|
|
|
|
Figure width (inches) |
|
|
|
Figure height (inches) |
|
|
|
Output resolution |
|
|
|
Interpolation method |
|
|
|
Smoothing parameters |
Notes#
Uses RMSD as reaction coordinate if available, image index otherwise
Applies the
ruhithemeLabels reactant, product, and saddle points
plot_orca_neb_landscape#
plot_orca_neb_landscape(
neb_data, output, *, width=5.37, height=5.37, dpi=200, method="grad_matern",
project_path=True
)
Publication ORCA NEB 2D landscape using plot_landscape_surface() and plot_landscape_path_overlay().
Parameters#
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
Typed result from |
|
|
|
Output file path |
|
|
|
|
Figure width (inches) |
|
|
|
Figure height (inches) |
|
|
|
Output resolution |
|
|
|
Surface interpolation method |
|
|
|
Project to reaction valley coordinates |
Raises#
Exception |
Condition |
|---|---|
|
|
Module: chemparseplot.plot.theme#
PlotTheme#
Frozen dataclass holding all aesthetic parameters.
Field |
Type |
Description |
|---|---|---|
|
|
Theme identifier |
|
|
Font family name |
|
|
Base font size |
|
|
Figure/axes background |
|
|
Text and label color |
|
|
Axes edge color |
|
|
Grid line color |
|
|
Default colormap for profiles |
|
|
Default colormap for landscapes |
|
|
Accent color |
|
|
Structure caption face. The default is Atkinson Hyperlegible, the ruhi face. |
Built-in Themes#
Name |
Font |
Colormap |
Notes |
|---|---|---|---|
|
Atkinson Hyperlegible |
|
Default theme |
|
Atkinson Hyperlegible |
|
Crameri scientific colormap |
get_theme(name, **overrides)#
Retrieves a theme by name, applying optional field overrides.
setup_global_theme(theme)#
Sets plt.rcParams from the theme (font, colors, sizes).
The Ruhi line colours become the colour cycle and the theme’s landscape map the default image map.
setup_publication_theme(theme, journal=None)#
Extends setup_global_theme() with publication defaults: spine removal, line widths, DPI 300, tight bbox.
With journal (a preset key or alias such as "jctc"), applies the style of chemparseplot.plot.journal instead.
apply_axis_theme(ax, theme)#
Applies theme properties to a specific axes instance (facecolor, spine colors, tick colors).
build_cmap(hex_list, name)#
Builds and registers a LinearSegmentedColormap from hex color strings.
Module: chemparseplot.plot.journal#
Journal presets and the figure style derived from them. Lengths follow the lettering and line standards of the International Organization for Standardization (ISO). All sizes are in PostScript points (72 per inch) unless marked as inches.
Presets#
Key |
Aliases |
Widths (in) |
Height limit (in) |
Text (pt) |
Smallest text (pt) |
Thinnest line (pt) |
Raster (dpi) |
|---|---|---|---|---|---|---|---|
|
|
single 3.33, double 7.00 |
9.17 |
10, 9, 8 |
4.5 |
0.5 |
1200 |
|
|
single 3.35, double 6.69 |
8.25 |
9.96, 8.97, 8 |
8 |
0.5 |
1200 |
|
|
single 3.54, onehalf 5.51, double 7.48 |
none |
9.96, 8.97, 7.97 |
7 |
0.25 |
1000 |
|
|
single 3.27, double 6.73 |
9.17 |
8.97, 7.97, 7 |
7 |
none |
600 |
Text sizes are the body, \small and \footnotesize sizes, at least the smallest text.
DEFAULT_JOURNAL is "acs"; PRESETS maps keys to presets and ALIASES journal abbreviations to keys.
JournalPreset#
Frozen dataclass of what a journal fixes for its figures.
Field |
Type |
Description |
|---|---|---|
|
|
Preset key |
|
|
Publisher and journals |
|
|
Figure width in inches by column span |
|
|
Tallest figure in inches; |
|
|
|
|
|
Smallest lettering |
|
|
Thinnest line; |
|
|
Resolution for raster output |
|
|
Faces the journal names |
|
|
Panel letter format |
|
|
Author guidelines the values come from |
width(columns) returns the width for a column span and raises ValueError for spans the journal lacks.
get_preset(journal)#
Looks up a preset by key or alias, case-insensitively; raises ValueError for unknown names.
figure_style#
figure_style(journal="acs", *, font=None, theme="ruhi")
Returns a JournalStyle, the lengths derived from the preset.
Here h is the capital height of the face at the body size.
Field |
Derivation |
|---|---|
|
Class sizes in PostScript points, at least |
|
h, measured from the outline of “H” |
|
ISO 3098-1 stroke 0.1 h divided by sqrt(2) (one ISO 128-2 step), at least |
|
2 and 4 times |
|
0.7 h and 0.3 h (x-height and descender) |
|
0.6 h and 0.2 h (word and character space) |
|
h |
|
From |
Text is set in font, by default the theme’s face.
Where that face is not installed the faces the journal names stand in.
Missing ones give way to their metric clones (Nimbus Sans, Liberation Sans, Arimo), and DejaVu Sans comes last.
rc() returns the rcParams and halo(color) path effects that outline text.
pitch is the baseline spacing of stacked \small labels, 1.5 h at that size.
marker_large is one sqrt(2) step larger than marker.
apply_style and journal_style#
apply_style(journal="acs", **kwargs)
journal_style(journal="acs", **kwargs)
apply_style puts the style into the global rcParams and returns it.
journal_style is a context manager that yields the style and restores the rcParams on exit.
Keyword arguments go to figure_style.
journal_figure#
journal_figure(journal="acs", columns="single", *, nrows=1, ncols=1,
aspect=None, height=None, style=None, **subplots_kw)
Returns (fig, axes) as plt.subplots does, for a constrained-layout figure at the exact column width.
Without style the journal style is applied globally.
The height is height inches.
Without height it is the width times aspect times nrows / ncols.
aspect is the panel height over width, by default PANEL_ASPECT (2/3).
A height above the journal’s limit raises ValueError.
fit_height(fig, *, dpi=None)#
Shrinks the figure height to its content, keeping the width, for equal-aspect maps that leave empty bands. Stops when the height changes by less than one output pixel. Returns the new height in inches.
save_figure(fig, path, *, dpi=None, **savefig_kw)#
Saves at the exact figure size (no tight bounding box) with TrueType fonts embedded. PDF and SVG files carry no creation date and SVG ids use a fixed salt, so the bytes are the same on every run. Returns the path.
label_panels#
label_panels(target, labels=None, *, fmt=None, journal=None, fontweight="normal")
Letters the panels of a figure, or a sequence of panels, in order from “(a)”. Each letter goes above the top left of its panel, on the left edge of the panel’s tick labels and y label. Panels in one grid column share that edge. Returns the texts.
Labels and legends#
Function |
Description |
|---|---|
|
Labels at the line ends (default right) in a shade of the line colour that reaches 4.5:1, moved apart by least squares where they would collide |
|
Direct labels where they touch no data, otherwise |
|
Label at a free end of a horizontal reference line, otherwise a legend entry |
|
Legend inside the panel where it covers no data, otherwise in one row above it |
|
Colour and ISO 128-2 line type of series |
Arguments after ax are optional except line and label; lines default to the labelled lines of ax.
Scales#
Function |
Description |
|---|---|
|
|
|
Log scale with decades labelled as powers of ten and unlabelled minor ticks |
|
Plain numbers from 0.1 to 1000, powers of ten outside, never an offset |
axis is "x", "y" (default) or "both".
Constants#
Name |
Value |
Source |
|---|---|---|
|
ISO 128-2 types 01, 02, 07, 04 and 10 as |
ISO 128-2:2020 |
|
|
National Institute of Standards and Technology Special Publication 811 (2008), section 7.9 |
|
2/3 |
Tufte (1983), p. 190 |
Module: chemparseplot.plot.palette#
The Ruhi palette (Ruhila Goswami), the colour science used to check it and the colour maps built from it.
Colours#
Name |
Type or value |
Description |
|---|---|---|
|
|
coral |
|
|
Names in line order: teal, sky, magenta, sunshine, coral |
|
|
Hex values in line order |
|
|
Okabe-Ito palette, the reference of |
|
|
Web Content Accessibility Guidelines (WCAG) 2.1, criterion 1.4.3 |
|
|
WCAG 2.1, criterion 1.4.11 |
Colour maps#
ruhi_seq (RUHI_SEQUENTIAL) and ruhi_div (RUHI_DIVERGING) and their reversed _r forms are registered with matplotlib when the module is imported.
Function |
Description |
|---|---|
|
Table of |
|
Table of |
|
|
|
Registers both maps (called on import) |
n defaults to the image.lut rcParam.
Checks#
palette_report#
palette_report(colors=None, background="white", reference=OKABE_ITO)
Returns a PaletteReport of colors (default RUHI_COLORS).
Its contrast is the WCAG contrast of each colour on background.
Its min_delta_e is the smallest CIEDE2000 difference between any two colours for each vision type.
The keys are "normal", "protan", "deutan" and "tritan".
reference_min_delta_e gives the same numbers for reference.
colormap_report(cmap)#
Returns a ColormapReport holding L* and the CIEDE2000 step between neighbouring entries for each vision type.
Its methods lightness_monotonic(kind), arms_monotonic(kind) (for diverging maps) and step_cv(kind) summarise them.
step_cv is the coefficient of variation of the steps.
Element colours#
assign_element_colors(reference, colors, anchors=CPK_ANCHORS)
Returns a map from each symbol of reference to one of the hex values in colors.
reference maps each element to its usual colour, such as its Jmol colour.
The anchors take colors one to one.
Their pairing is the one with the least summed CIEDE2000 difference from their reference colours.
Every other element takes the colour of the anchor whose reference colour is nearest its own.
colors needs one entry per anchor, or a ValueError is raised.
An anchor missing from reference raises a KeyError.
Name |
Value |
Source |
|---|---|---|
|
|
The atoms of the Corey and Pauling models (1953), p. 622 |
chemparseplot.plot.render.ELEMENT_COLORS is this map for the Jmol colours in ASE and the four Ruhi colours other than coral.
Colour science#
background defaults to white.
Function |
Description |
|---|---|
|
sRGB (International Electrotechnical Commission standard 61966-2-1) to CIELAB or CIELCh, D65 |
|
CIELCh to sRGB; out-of-gamut colours lose chroma at fixed L* and hue |
|
CIEDE2000 colour difference |
|
Protan, deutan or tritan vision (Machado et al., 2009, severity 1) |
|
WCAG 2.1 contrast ratio |
|
|
|
The candidate (default black or white) whose smallest contrast with |
|
Colours passing 3:1 first, each next one furthest in CIEDE2000 from those chosen over all four vision types |
Module: chemparseplot.plot.optimization#
Functions for single-ended method (dimer, minimization) visualization.
plot_optimization_landscape#
plot_optimization_landscape(
ax, rmsd_a, rmsd_b, grad_a, grad_b, z_data, *, label_mode="optimization",
project_path=True, method="grad_matern", cmap="ruhi_diverging", energy_unit="eV",
z_label=None, **surface_kwargs,
)
Wraps plot_landscape_surface() and plot_landscape_path_overlay() with semantically correct axis labels for single-ended methods.
Parameters#
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
|
All other parameters (including auto_thin, max_surface_points, surface_fit)
are passed through to plot_landscape_surface().
render_single_ended_landscape(...)#
Full single-ended pipeline (min/saddle CLIs). Accepts the same surface-fit
knobs (auto_thin default false, max_surface_points 64, surface_fit).
See plot_landscape_surface above.
plot_optimization_profile#
plot_optimization_profile(
ax, iterations, energies, *, eigenvalues=None, ax_eigen=None, color="#004D40",
eigen_color="#FF655D"
)
Plots energy (and optionally eigenvalue) vs iteration.
plot_convergence_panel#
plot_convergence_panel(ax_force, ax_step, dat_df, *, force_col="convergence",
step_col="step_size", iter_col="iteration", color="#004D40")
Plots convergence metrics (force norm and step size) from a trajectory DataFrame. Both scales are logarithmic, with decades labelled as powers of ten. Steps of zero length are left out, and a marker shows the last iteration.
plot_single_ended_convergence#
plot_single_ended_convergence(
trajs, labels, output, dpi, *, journal=None, columns="double",
threshold=None, threshold_label="Threshold",
force_label="Convergence", step_label="Step size",
)
Two panels, (a) the convergence measure and (b) the step size against iteration, saved to output.
The figure is in the style of journal (acs when None) and one columns of it wide.
Each trajectory needs a dat_df, as the eOn loaders return.
It gets its own colour and ISO 128-2 line type and is labelled at the end of its line.
When the labels would touch the data, a legend placed off the data replaces them.
threshold draws the convergence criterion as a dashed, labelled line.
The global rcParams are left as they were.
plot_relative_error#
plot_relative_error(ax, x, values, reference, *, label=None, index=0,
xlabel="Iteration", ylabel="Relative error")
Plots abs(values - reference) / abs(reference) on a log scale with decades labelled as powers of ten.
Errors below machine epsilon are drawn at epsilon, so an exact result stays on the plot.
The line takes the colour and line type of series_style(index).
Returns the line.
plot_dimer_mode_evolution#
plot_dimer_mode_evolution(ax, mode_vectors, *, color="#004D40")
Plots alignment of per-iteration dimer mode with the final converged mode (|cos(mode, final)|).
Module: chemparseplot.plot.chemgp#
plot_surface_contour#
plot_surface_contour(
grid_x, grid_y, grid_z, paths=None, points=None,
clamp_lo=None, clamp_hi=None, levels=None, contour_step=None,
_point_style="star", width=None, height=None, *,
journal=None, columns="single", cmap=None,
xlabel=r"$x$", ylabel=r"$y$", zlabel=r"$E$ (eV)",
)
Filled contour map of a 2D surface with optional paths and stationary points, in the journal style. Returns the figure.
Parameters#
All but the three grids have defaults:
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
array |
Meshgrid arrays of the surface |
|
|
|
|
|
|
|
|
|
|
|
|
Clipping range of the surface values |
|
|
|
Filled levels, the colour-bar ticks of matplotlib’s locator when |
|
|
|
Spacing of the contour lines, the filled levels when |
|
|
|
Figure size in inches, the column width and the height the map needs when |
|
|
|
Journal whose style goes into the global rcParams ( |
|
|
|
Column span of the default width |
|
|
|
Colour map ( |
|
|
x, y, E (eV) |
x, y and colour-bar labels |
Notes#
The x and y scales are equal; without
heightthe figure is shrunk to its content withfit_height.Filled bands, contour lines and colour-bar ticks share one set of levels.
Each contour line is black or white, whichever contrasts more with the bands on both sides.
Image numbers are below the path and point labels above it, so they never cover each other at a stationary point.
Module: chemparseplot.parse.projection#
Shared (s, d) reaction valley projection utilities.
ProjectionBasis#
Frozen dataclass storing the orthonormal basis vectors for the projection.
Field |
Type |
Description |
|---|---|---|
|
|
RMSD origin (first point) |
|
|
Unit vector along path direction |
|
|
Unit vector perpendicular to path |
|
|
Path length in RMSD space |
compute_projection_basis(rmsd_a, rmsd_b) -> ProjectionBasis#
Computes basis from first/last points of the arrays.
project_to_sd(rmsd_a, rmsd_b, basis) -> (s, d)#
Forward projection from RMSD space to reaction valley coordinates.
inverse_sd_to_ab(s, d, basis) -> (rmsd_a, rmsd_b)#
Inverse transform for grid evaluation on projected surfaces.