This module provides compact quick-look plots for
pycsamt.inversion.results.InversionResult objects. The public
functions are intentionally small and backend-neutral: each plot consumes the
common result API rather than SimPEG, pyGIMLi, Occam2D, ModEM, or built-in
solver internals.
The plotting helpers follow the shared pyCSAMT plotting API. Section-like views
use pycsamt.api.section.PYCSAMT_SECTION, diagnostic line styling uses
pycsamt.api.style.PYCSAMT_STYLE, and optional saving goes through
pycsamt.api.plot.save_fig().
Depth is positive downward. Model values are stored as
log10(rho/ohmm) by the interpretation model container, and plotting uses
that log scale by default. Pass log_rho=False to display linear
resistivity in ohm metres.
plot_model is the quick-look model visualizer for
pycsamt.inversion.results.InversionResult. It first converts the
result through result.to_resistivity_model() and then chooses the plot
type from the recovered grid shape:
one model column -> a depth profile using Axes.step;
multiple columns -> a profile/depth section using Axes.pcolormesh.
The depth axis is positive downward, matching
pycsamt.interp.ResistivityModel and the rest of the interpretation
API. Section sizing, station labels, colorbar style, and optional saving use
the shared pyCSAMT plotting configuration.
ax (matplotlib Axes, optional) – Existing axes to draw into. If omitted, a new figure and axes are
created using the selected section style.
log_rho (bool, default True) – Plot log10(rho/ohmm) values. If False, values are converted
to linear resistivity in ohm metres before plotting.
cmap (str, default "jet_r") – Matplotlib colormap for 2-D sections. Ignored for single-column 1-D
depth profiles.
colorbar (bool, default True) – Add a colorbar for 2-D section plots. Ignored for single-column 1-D
depth profiles.
show_stations (bool, default True) – Draw station markers and labels using the section station preset when
station positions are available.
section (str or SectionStyle, default "inversion") – Shared section style preset name or explicit
pycsamt.api.section.SectionStyle object. Names are resolved
through pycsamt.api.section.PYCSAMT_SECTION.
title (str, optional) – Axes title. If omitted, a backend/method/dimension summary is used.
savepath (str, optional) – If given, save the figure using pycsamt.api.plot.save_fig().
The path may omit the extension when global pyCSAMT plot formats are
configured.
savefig_kw (dict, optional) – Extra keyword arguments forwarded to save_fig.
The function does not call matplotlib.pyplot.show. This keeps it safe
for scripts, notebooks, test suites, and batch figure generation. Use the
returned axes to further customize labels, limits, annotations, or overlays.
plot_rms visualizes the weighted root-mean-square misfit stored on an
pycsamt.inversion.results.InversionResult. When
result.metadata["station_rms"] is available, the function draws one
marker per station. Otherwise it draws a single global RMS bar from
result.rms.
Parameters:
result (InversionResult) – Inversion result containing a global rms value and optionally
metadata["station_rms"].
ax (matplotlib Axes, optional) – Existing axes to draw into. If omitted, a new compact figure and axes
are created.
title (str, default "Inversion misfit") – Axes title.
RMS near 1 is often interpreted as consistency with the supplied data-error
model, but the correct target depends on data quality, error floors,
regularization strength, and backend conventions. This plot is therefore a
diagnostic companion to model plots rather than a standalone quality
guarantee.