-
Notifications
You must be signed in to change notification settings - Fork 0
/
heatmap.tex
35 lines (34 loc) · 1020 Bytes
/
heatmap.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
\documentclass[margin=10pt]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
%
\usetikzlibrary{shapes, shapes.geometric, shapes.arrows, arrows, patterns, positioning, calc}
%
\begin{document}
\begin{tikzpicture}[scale=0.6]
\foreach \y [count=\n] in {
{74,25,39,20,3,3,3,3,3},
{25,53,31,17,7,7,2,3,2},
{39,31,37,24,3,3,3,3,3},
{20,17,24,37,2,2,6,5,5},
{3,7,3,2,12,1,0,0,0},
{3,7,3,2,1,36,0,0,0},
{3,2,3,6,0,0,45,1,1},
{3,3,3,5,0,0,1,23,1},
{3,2,3,5,0,0,1,1,78},
} {
% column labels
\ifnum\n<10
\node[minimum size=6mm] at (\n, 0) {\n};
\fi
% heatmap tiles
\foreach \x [count=\m] in \y {
\node[line width=1.2mm, draw=white, fill=yellow!\x!purple, minimum size=6mm, text=white] at (\m,-\n) {\x};
}
}
% row labels
\foreach \a [count=\i] in {a,b,c,d,e,f,g,h,i} {
\node[minimum size=6mm] at (0,-\i) {\a};
}
\end{tikzpicture}
\end{document}