pvtend.plotting.plot_var
- pvtend.plotting.plot_var(var_spec: str | list[str] | Callable, *, data_root: str, stage: str = 'onset', dh: int = 0, level: str | int = 'wavg', projection: bool = False, smooth_deg: float = 3.0, grid_sp: float = 1.5, n_boot: int = 1000, alpha: float = 0.05, seed: int = 42, pv_contour: float = 0.0, n_contour: int = 21, figsize_scale: float = 1.0, label: str | None = None, vmax: float | None = None, use_sig_mask: bool = True, mask: str | bool | None = '< 0') dict[source]
Composite + bootstrap plot for any variable(s).
This is the main entry point, equivalent to
plot_var()from04_single_var_composite.ipynbbut usable from any notebook.- Parameters:
var_spec – Field specification —
str,list[str](with optional'-'prefix for negation), orcallable(event) → 2-D array.data_root – Path to the composite NPZ archive (e.g.
".../composite_blocking_tempest").stage – Lifecycle stage (
"onset","peak","decay").dh – Lifecycle hour offset.
level –
"wavg"or int hPa.projection – If
True, add 2×2 projection rows (INT/PRP/DEF/Resid).smooth_deg – Gaussian smoothing FWHM (degrees).
grid_sp – Grid spacing (degrees).
n_boot – Bootstrap resamples.
alpha – Significance level.
seed – Random seed.
pv_contour – PV anomaly contour level for overlay.
n_contour – Number of contourf levels.
figsize_scale – Scale factor for figure size.
label – Custom title label (auto-generated if
None).vmax – Fixed colour-scale max. When
None(default) the 95th percentile of|mean|is used. Pass the same value to multiple calls to enforce a shared colour range.
- Returns:
Result dict with key
"vmax"(the colour-range used) and, whenprojection=True, all projection keys (beta,ax,ay,gamma1,gamma2,sigma, etc.).