calamari.plot#
Matplotlib plotting helpers for calamari.
This package and calamari.style contain all direct matplotlib imports
(PL-1, docs/ARCHITECTURE.md). Every helper takes the
measurement (or family of measurements) first and an optional ax=,
and leaves figure-level concerns – layout, colourbars, calling
legend – to the caller, so the helpers compose into multi-panel
figures.
The package has two layers with a public seam. Resolution
(chi_series(), moment_series()) turns a Measurement plus
a units/source request into PlotSeries objects – pure arrays
and label strings, no drawing. All the physics and robustness lives
there: unit conversion through Sample,
AC-versus-DC source selection, housekeeping-row exclusion, NaN-row
dropping, per-frequency splitting, error-bar propagation. Drawing
(plot_chi_vs_t() and friends) resolves and then draws. Call the resolution layer yourself when the drawing layer’s
choices do not fit.
Quickstart#
>>> import calamari
>>> m = calamari.load("run.dat")
>>> ax = calamari.plot.plot_chi_vs_t(m, component="both")
>>> calamari.plot.save(ax, "chi.pdf")
Every helper takes ax= to draw into an existing figure (multi-panel
composition) and creates one via pyplot only when ax is omitted.
**style kwargs are forwarded untouched to the underlying matplotlib
call (ax.plot/ax.errorbar; ax.pcolormesh for
plot_moment_map()), so anything matplotlib accepts there is
accepted here.
Module attributes
Neighbours on each side that a point is compared against by the map glitch check -- the shared |
|
Glitch score above which a map point is reported (and, with |
|
Format written when |
|
Percentiles draw_map's |
|
The smoothed representations a detection records per sweep and signal ( |
Functions
Return the axis-label text for a (quantity, units) pair. |
|
Build a chi(T, H) |
|
Resolve a susceptibility-vs-T (or vs-H) request into PlotSeries. |
|
Render a |
|
Resolve Fisher's d(chi T)/dT against temperature, in physical units. |
|
Interpolate a map's family axis: filled colour between the sweeps. |
|
Build an M(T, H) |
|
Resolve a moment-vs-H (or vs-T) request into PlotSeries. |
|
Draw transition candidates onto existing axes. |
|
Draw a |
|
Resolve and draw a chi(T, H) map in one call. |
|
Plot susceptibility (or 1/chi) against applied field. |
|
A family of chi(H) sweeps on one axes, each curve labelled by its temperature. |
|
Plot susceptibility (or 1/chi) against temperature. |
|
A family of chi(T) sweeps on one axes, each curve labelled by its field. |
|
Draw one smoothed curve a detection searched, with that sweep's candidates on it. |
|
Overlay one curve per measurement, labelled by each sweep's fixed parameter. |
|
Plot Fisher's d(chi T)/dT against temperature. |
|
Overlay a fitted model curve. |
|
Plot one fitted parameter against the fitting window's edge. |
|
Plot moment against applied field, M(H). |
|
A family of M(H) sweeps on one axes, each curve labelled by its temperature. |
|
Resolve and draw an M(T, H) map in one call; see |
|
Plot moment against temperature, M(T). |
|
A family of M(T) sweeps on one axes, each curve labelled by its field. |
|
Draw each tracked feature's location against the smoothing window. |
|
Draw one smoothed representation of a sweep at every window of a scan. |
|
Draw candidate coordinates without manufacturing a background map. |
|
Write a figure to one or more files, from the axes a helper returned. |
Classes
One point the map glitch check flagged, with what was done to it. |
|
A resolved 2-D map on the T-H plane, in fixed orientation. |
|
One drawable series: data arrays plus the labels that describe them. |