I'm using tabularray to create my confusion matrix but I've been unable to automatically changing the background color of it, like many examples out there:
- https://tex.stackexchange.com/a/338931/306714.
- Are there an easy way to coloring tables depending on the value in each cell?
Here is my minimal working example:
\documentclass{article}
\usepackage{color}
\usepackage{tabularray}
\usepackage{graphicx}
\begin{document}
\begin{table}
\centering
\resizebox{\linewidth}{!}{%
\begin{tblr}{
cell{1}{3} = {c=3}{},
cell{3}{1} = {r=3}{},
}
& & Predicted & & \
& & Class A & Class B & Class C \
Actual & Class A & 1.00 & & 0.10 \
& Class B & 0.10 & 0.80 & 0.10 \
& Class C & 0.30 & & 0.70
\end{tblr}
}
\end{table}
\end{document}
I've been unsuccessful in applying a formula to a range, such as:
cell{3-5}{3-5} = {cmd=\formula_to_automatically_scale_color} Or directly applying it to a cell: \formula_to_automatically_scale_color{} nothing seems to work.
I would greatly appreciate your help
