Deborah.Rebekah.PXvsBSPlotter

Deborah.Rebekah.PXvsBSPlotter.plot_PX_BS_vs_labelsMethod
plot_PX_BS_vs_labels(
    key::String,
    suffix_orig::String,
    suffix1::String,
    suffix2::String,
    train_pct::Int,
    new_dict::Dict{String, Array{Float64,2}},
    labels_int::Vector{Int},
    trains_ext_int::Vector{Int},
    overall_name::String,
    figs_dir::String;
    key_tex::String = "",
    save_file::Bool = false
) -> Nothing

Plot P1, P2, and original results versus labeled set percentage for a fixed training set size.

This function compares three estimation methods for a given observable key at a fixed training set percentage train_pct. It extracts the average values and error bars from new_dict using three suffixes:

  • suffix_orig: baseline (e.g., "Y_BS")
  • suffix1: first method (e.g., "Y_P1")
  • suffix2: second method (e.g., "Y_P2")

All three curves are plotted against labels_int ($x$-axis), with distinct markers, colors, and error bars. The $y$-values are extracted for the corresponding column of train_pct in trains_ext_int.

Arguments

  • key::String: Observable name (e.g., "TrM1", "Deborah"). If "Deborah", the dict key omits prefix.
  • suffix_orig::String: Suffix for the baseline method (e.g., "Y_BS").
  • suffix1::String: Suffix for the first estimation method (e.g., "Y_P1").
  • suffix2::String: Suffix for the second estimation method (e.g., "Y_P2").
  • train_pct::Int: Training set percentage to fix the column index for $y$-values.
  • new_dict::Dict{String, Array{Float64,2}}: Dictionary containing precomputed average and error matrices.
  • labels_int::Vector{Int}: Label set percentages ($x$-axis values).
  • trains_ext_int::Vector{Int}: Training percentages (used to resolve column index).
  • overall_name::String: Identifier string used in the saved filename.
  • figs_dir::String: Output directory to save the figure.

Keyword Arguments

  • key_tex::String = "": $\LaTeX$ string for $y$-axis label.
  • save_file::Bool = false: Whether to save the figure as PDF. If true, attempts to crop using pdfcrop.

Behavior

  • $X$-axis: labels_int, with slight left/right shifts for suffix1 and suffix2 for clarity.
  • $Y$-axis: Observable value with error bars.
  • Marker shapes: "s" (square) for suffix_orig, "^" for suffix1, "o" for suffix2.
  • Raises an error if train_pct not found.
source
Deborah.Rebekah.PXvsBSPlotter.plot_PX_BS_vs_trainsMethod
plot_PX_BS_vs_trains(
    key::String,
    suffix_orig::String,
    suffix1::String,
    suffix2::String,
    label_pct::Int,
    new_dict::Dict{String, Array{Float64,2}},
    trains_ext_int::Vector{Int},
    labels_int::Vector{Int},
    overall_name::String,
    figs_dir::String;
    key_tex::String = "",
    save_file::Bool = false
) -> Nothing

Plot P1, P2, and original results versus training percentage for a fixed label size.

This function compares three estimation methods for a given observable key at a fixed labeled set percentage label_pct. It extracts the average values and error bars from new_dict using three suffixes:

  • suffix_orig: baseline (e.g., "Y_BS")
  • suffix1: first method (e.g., "Y_P1")
  • suffix2: second method (e.g., "Y_P2")

All three curves are plotted against trains_ext_int ($x$-axis), with distinct markers, colors, and error bars. The $y$-values are extracted for the corresponding row of label_pct in labels_int.

Arguments

  • key::String: Observable name (e.g., "TrM1", "Deborah"). If "Deborah", the dict key omits prefix.
  • suffix_orig::String: Suffix for the baseline method (e.g., "Y_BS").
  • suffix1::String: Suffix for the first estimation method (e.g., "Y_P1").
  • suffix2::String: Suffix for the second estimation method (e.g., "Y_P2").
  • label_pct::Int: Label set percentage to fix the row index for $y$-values.
  • new_dict::Dict{String, Array{Float64,2}}: Dictionary containing precomputed average and error matrices.
  • trains_ext_int::Vector{Int}: Training set percentages ($x$-axis).
  • labels_int::Vector{Int}: Label set percentages (used to resolve row index).
  • overall_name::String: Identifier string used in the saved filename.
  • figs_dir::String: Output directory to save the figure.

Keyword Arguments

  • key_tex::String = "": $\LaTeX$ string for $y$-axis label.
  • save_file::Bool = false: Whether to save the figure as PDF. If true, tries to crop it using pdfcrop.

Behavior

  • X-axis: trains_ext_int with left/right offsets for clarity.
  • Y-axis: Observable value with error bars.
  • Marker shapes: "s" (square) for suffix_orig, "^" for suffix1, "o" for suffix2.
  • Raises an error if label_pct not found or if any $y$-values are NaN/Inf.

Side Effects

  • Displays a PyPlot figure comparing all three methods.
  • If save_file=true, saves a PDF under figs_dir/plot_<key>_<overall_name>_LBP_<label_pct>.pdf. If pdfcrop is available, the output is cropped automatically.
source