Deborah.Rahab.CorrPlot

Deborah.Rahab.CorrPlot.build_observablesMethod
build_observables(
    keys::AbstractVector{<:AbstractString},
    key_doc::AbstractVector{<:AbstractString},
    raw_path::AbstractString;
    real_col::Integer=1,
    file_ext::AbstractString=".dat"
) -> Matrix{Float64}

Read per-key data files from raw_path named as <key><file_ext> and extract column real_col (default: 1). Stack them so that each row corresponds to one key, preserving the order of keys. Returns only the matrix mat::Matrix{Float64}.

Arguments

  • keys: basenames like ["pbp", "trdinv2",...].
  • key_doc: doc strings (must be same length/order as keys).
  • raw_path: directory containing the files.
  • real_col: $1$-based column index to read (default: 1).
  • file_ext: file extension including dot (default: ".dat").

Throws

  • AssertionError if length(keys) != length(key_doc) or if sample lengths differ.
  • ArgumentError if a file is missing or real_col is out of bounds.
source
Deborah.Rahab.CorrPlot.corrmat_plotMethod
corrmat_plot(
    mat::AbstractMatrix{<:Real},
    key_doc::Vector{String},
    ensemble::String,
    figs_dir::String;
    save_file::Bool=false
) -> Nothing

Render and (optionally) save a heatmap of the absolute correlation matrix computed across the rows of mat (Statistics.cor(mat, dims=2)). Each row is treated as a variable and each column as a sample.

Arguments

  • mat: Real-valued data matrix of shape (n_vars $\times$ n_samples); rows are variables, columns are samples.
  • key_doc: Tick labels for variables (length must equal size(mat, 1)). Labels may include mathtext/$\LaTeX$-like strings (e.g., "$\mathrm{Tr} M^{-1}$").
  • ensemble: Identifier used to construct the output filename (e.g., "L8T4b1.60k13570"corr_L8T4b1.60k13570.pdf).
  • figs_dir: Directory where the PDF is written if save_file=true.

Keyword Arguments

  • save_file::Bool=false: When true, saves a PDF to figs_dir. If pdfcrop is available on the system PATH, a cropped version is produced and overwrites the original.

Behavior

  • Computes cormat = abs.(Statistics.cor(mat, dims=2)).
  • Draws a heatmap with vmin=0.0, vmax=1.0, and colormap "autumn_r".
  • Annotates each cell with its value (rounded to 3 digits) and chooses black/white text based on a fixed threshold (0.4) for contrast.
  • Sets both axes ticks to 0:(n_vars-1) with labels from key_doc, rotates $x$-tick labels by 60°, sets square cells via ax.set_aspect(1), calls tight_layout(), and displays the figure.
  • If save_file=true, writes <figs_dir>/corr_$(ensemble).pdf and, when available, runs pdfcrop and replaces the original with the cropped output.

Notes

Returns

  • Nothing.
source