Skip to content

Instantly share code, notes, and snippets.

View racarvajal's full-sized avatar
📡

Rodrigo Carvajal Pizarro racarvajal

📡
View GitHub Profile
@racarvajal
racarvajal / binary_perc_confusion_matrix.tex
Created September 24, 2025 09:54
Command to draw binary confusion matrices in LaTeX. It shows full value and row-based percentages
\documentclass{article}
%
\usepackage{graphicx,xcolor}
\usepackage{siunitx}
\usepackage{tikz}
\usetikzlibrary{matrix,positioning}
%%%% Confusion Matrix Body definition %%%%
\NewDocumentCommand{\confusionmatrixperc}{O{false}mmmmmm}{
\pgfmathsetmacro{\maxval}{max(max(#2,#3),max(#4,#5))}
@racarvajal
racarvajal / flowchart_draw.tex
Last active August 21, 2025 10:07
Draw flowchart with TikZ
\documentclass[tikz]{standalone}
\usetikzlibrary{shapes.geometric, arrows.meta, positioning, fit, calc, backgrounds}
\definecolor{highlight}{RGB}{52,152,250}
% TikZ styles
\tikzset{
nodeminwidth/.store in=\nodeminwidth,
nodeminheight/.store in=\nodeminheight,
nodeminwidth =3cm,
@racarvajal
racarvajal / test_2d_hist_vector_unc.py
Created July 18, 2025 16:09
Script to plot 2D histogram including uncertainties
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import binned_statistic_2d
# Example parameters
np.random.seed(42)
N_sources = 10000
N_samples_per_source = 500
# Simulated asymmetric uncertainties
@racarvajal
racarvajal / binary_confusion_matrix.tex
Last active August 29, 2024 17:41
Command to draw binary confusion matrices in LaTeX
\documentclass{article}
%
\usepackage{graphicx,xcolor}
\usepackage{siunitx}
\usepackage{tikz}
\usetikzlibrary{matrix,positioning}
%%%% Confusion Matrix Body definition %%%%
\NewDocumentCommand{\confusionmatrix}{O{false}mmmmmm}{
\pgfmathsetmacro{\maxval}{max(max(#2,#3),max(#4,#5))}