% Created by Dan O'Shea (@djoshea) 2022.
% Inspired by https://www.nature.com/nature-index/news-blog/researchers-embracing-visual-tools-contribution-matrix-give-fair-credit-authors-scientific-papers
\documentclass[margin=1mm]{standalone}
\PassOptionsToPackage{svgnames}{xcolor}
\usepackage{tikz} 
\usetikzlibrary{calc,intersections}
% fonts: you can uncomment this if you want to use pdflatex instead of xelatex (see options in Menu)
\usepackage{fontspec} 
\setmainfont{NewComputerModernSans08}
\tikzset{
    tile/.style = {
        align=center,
        minimum size=6mm,
        anchor=north west,
    },
    col header/.style={
        tile,
        anchor=north west,
        yshift=-1mm,
        rotate=45,
        inner sep=0,
        outer sep=0,
    },
    row label/.style={
        tile,
        anchor=north east,
        inner sep=0,
        outer sep=0,
        xshift=3mm,
    },
    legend line/.style={
        anchor=north west,
        inner xsep=0,
        inner ysep=2mm,
        outer sep=0,
    },
}
% define the intensity levels here
\def\hi{100}
\def\mid{50}
\def\lo{20}
% and the 100% intensity color here, which will blended to white
\colorlet{tilecolor}{Orchid}
\begin{document}
\begin{tikzpicture}[scale=0.6]
    % column labels
    \foreach \a [count=\n] in {
        Author 1*,
        Author 2*,
        Author 3,
        Author 4,
        Author 5,
        Author 6,
        Author 7,
        Author 8,
        Author 9,
        Author 10$^\dagger$,
        Author 11$^\dagger$,
    } {
        \node[col header] at (\n,0) {\a};
    }
    % row labels
    \foreach \a [count=\i] in {
        Conceptualization,
        Formal analysis,
        Investigation,
        Methodology,
        Resources, 
        Software,
        Writing---Original Draft,
        Writing---Reviewing and Editing,
        Funding acquisition,
    } {
        \node[row label] at (0,-\i) {\a};
    }
    \foreach \y [count=\n] in {
        {\hi,\hi,\lo,0,0,0,0,0,0,\hi,\hi},
        {\hi,0,\hi,0,0,0,\mid,\mid,\mid,0,\mid},
        {\hi,\lo,0,\hi,\hi,\mid,0,0,0,0,\mid},
        {\hi,\lo,0,0,0,0,0,0,0,0,0},
        {\lo,\hi,0,0,0,0,0,0,0,\lo,0},
        {\hi,\mid,0,0,0,0,0,0,0,\mid,0},
        {\hi,\hi,0,0,0,0,0,0,0,\mid,0},
        {\hi,\hi,0,0,0,0,0,0,0,\mid,\lo},
        {0,0,0,0,0,0,0,0,\lo,\hi,\hi},
    } {
        % heatmap tiles
        \foreach \x [count=\m] in \y {
            \node[fill=tilecolor!\x!white, tile, text=white] (tile) at (\m,-\n) {};
        }
    }
    % description below heatmap 
    \node [legend line] at (1, 0 |- tile.south) {*, $^\dagger$ these authors contributed equally};
\end{tikzpicture}
\end{document}