plot — Visualize Results¶
The plot subcommand reads .parquet snapshot files (produced by snap) and generates publication-quality plots. No heavy computation is performed — it is purely a visualization tool.
Basic Usage¶
# Plot r vs clusters and all spectra
r_analysis plot --parquet-dir snapshots/ -arc -as
# Plot everything
r_analysis plot --parquet-dir snapshots/ -a
# Filter to specific runs
r_analysis plot --parquet-dir snapshots/ -r "kmeans_BD4000" -ar -as
Input¶
Flag |
Type |
Default |
Description |
|---|---|---|---|
|
|
required |
Directory(ies) containing |
|
|
all |
Regex patterns to filter parquet rows by keyword |
Visualization Toggles¶
Per-Run Plots¶
These generate one plot per run entry in the parquet file:
Flag |
Description |
|---|---|
|
Spectral parameter maps (\(\beta_d\), \(T_d\), \(\beta_s\)) |
|
Patch/cluster assignment maps |
|
\(C_\ell^{BB}\) power spectra (one per run) |
|
CMB Q/U reconstruction maps |
|
Systematic residual maps |
|
Statistical residual maps |
|
\(r\) likelihood curve (single run) |
|
Parameter maps with residuals vs truth |
|
Illustration plots |
Aggregate Plots (Multi-Run)¶
These overlay multiple runs on a single figure:
Flag |
Description |
|---|---|
|
All \(C_\ell^{BB}\) spectra overlaid |
|
\(r\) likelihood comparison across runs |
|
Histograms of parameters across all runs |
Correlation Plots¶
These plot metrics as a function of run properties (e.g., number of clusters):
Flag |
Description |
|---|---|
|
\(r\) vs number of clusters |
|
Variance vs number of clusters |
|
NLL vs number of clusters |
|
\(r\) vs variance |
All-in-One¶
Flag |
Description |
|---|---|
|
Enable all plot types above |
Group Plots¶
Group multiple runs together for aggregate comparison:
r_analysis plot --parquet-dir snapshots/ \
-g "kmeans_BD4000" "ptep_BD64" \
-gt "K-Means" "PTEP" \
-ar -as
Flag |
Type |
Description |
|---|---|---|
|
|
Regex patterns defining named groups |
|
|
Human-readable titles for each group |
|
|
Per-row title overrides (curve labels) |
Figure Customization¶
Flag |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
Output directory |
|
|
|
Output format: |
|
|
|
Font size for all text |
|
|
auto |
Custom color list for curves (cycles if fewer than runs) |
|
|
auto |
X-axis limits for \(r\)-estimation plots |
|
|
auto |
Legend position |
|
|
auto |
Legend position |
|
|
auto |
Figure size |
|
|
auto |
Figure size |
|
|
none |
\(r\) fill-between range for spectra plot |
|
|
none |
Two truth \(r\) values shown as vertical lines |
Examples¶
Compare K-Means configurations¶
r_analysis plot --parquet-dir snapshots/ \
-r "kmeans" \
-arc -ar \
--output-format pdf \
-o figures/
Side-by-side K-Means vs PTEP¶
r_analysis plot --parquet-dir snapshots/ \
-g "kmeans" "ptep" \
-gt "Adaptive K-Means" "Multi-Resolution (PTEP)" \
-as -ar \
--r-figsize 10 6 \
--font-size 16
Publication-quality r likelihood¶
r_analysis plot --parquet-dir snapshots/ \
-r "kmeans_BD4000_GAL020" \
-ar \
--xlim -0.01 0.02 \
--r-plot 0.0 0.004 \
--output-format pdf \
--font-size 18