thermostrife.viz

Wong-palette raincloud and null-density figures. Triple output: SVG + PNG + CSV.

.. py:module:: thermostrife.viz

Plotting helpers. Rainclouds, not bar charts.

.. py:function:: plot_anomaly_raincloud(events_df: pandas.DataFrame, output_dir: ~pathlib.Path, stem: str = ‘anomaly_raincloud’, annotation: str | None = None) -> ~pathlib.Path :module: thermostrife.viz

Half-violin + jittered strip + boxplot of per-event anomalies.

events_df must have at least the columns event_id, anomaly_C, and provenance. Points are coloured by the TIER_COLOURS mapping. annotation (e.g. the H2 OR / p-value string) is overlaid in the lower right.

.. py:function:: plot_null_density(observed_stat: float, null_draws: numpy.ndarray, output_dir: ~pathlib.Path, stem: str = ‘null_density’, two_sided_p: float | None = None) -> ~pathlib.Path :module: thermostrife.viz

Permutation-null KDE with the observed statistic marked.

.. py:function:: plot_warming_stripes_timeline(annual_temp: pandas.Series, panels: dict[str, pandas.DataFrame], output_dir: ~pathlib.Path, stem: str = ‘warming_stripes_timeline’, cmap_name: str = ‘RdBu_r’, stripe_clip_sigma: float = 2.6) -> ~pathlib.Path :module: thermostrife.viz

Hawkins-style annual warming stripes + event markers per panel.

Background: one stripe per year coloured by that year’s deviation from the long-term mean of annual_temp (a Series indexed by year). Foreground: a row per panel with one marker per event, coloured by the event’s per-event anomaly.

.. py:function:: plot_superposed_epoch(profiles: dict[str, pandas.DataFrame], output_dir: ~pathlib.Path, stem: str = ‘superposed_epoch’, panel_colours: dict | None = None, ci_level: float = 0.95) -> ~pathlib.Path :module: thermostrife.viz

Superposed-epoch overlay: mean anomaly vs offset_days per panel.

Each panel’s DataFrame has columns event_id, offset_days, anomaly_C. Bootstrap CI per offset; flat profile near zero = null; bump centred on offset 0 = heat-aggression signature.

.. py:function:: plot_forest_h2(rows: list[dict], output_dir: ~pathlib.Path, stem: str = ‘forest_h2’, ref_x: float = 1.0) -> ~pathlib.Path :module: thermostrife.viz

Forest plot of H2 OR-per-+1 °C estimates with 95 % CI whiskers.

rows is a list of dicts with keys label, or, ci_low, ci_high, optional colour, optional n. Plotted bottom-up.

.. py:function:: plot_anomaly_by_year(events_df: pandas.DataFrame, output_dir: ~pathlib.Path, stem: str = ‘anomaly_by_year’, rolling_window: int = 11) -> ~pathlib.Path :module: thermostrife.viz

Scatter of per-event anomaly vs event year + rolling mean.

events_df must have event_id, year, anomaly_C, provenance columns.