I am trying to draw the following figure:
I have found an example to create the table in confusion matrix using only LaTeX code and tried to adapt the solution to my table
\documentclass{article}
%\usepackage{ifthen}
%\usetikzlibrary{matrix,calc}
\usepackage{graphicx}
\newcommand\MyBox[1]{%
\fbox{\parbox[c][1.7cm][c]{1.7cm}{\centering #1}}%
}
\newcommand\MyVBox[1]{%
\parbox[c][1.7cm][c]{1cm}{\centering\bfseries #1}%
}
\newcommand\MyHBox[2][\dimexpr1.7cm+2\fboxsep\relax]{%
\parbox[c][1cm][c]{#1}{\centering\bfseries #2}%
}
\newcommand\MyTBox[4]{%
\MyVBox{#1}\MyBox{#2}\hspace{-\fboxrule}%
\MyBox{#3}\hspace{-\fboxrule}%
\MyBox{#4}\par\vspace{-\fboxrule}
}
\begin{document}
{
\offinterlineskip
% \raisebox{-5cm}[0pt][0pt]{\rotatebox[origin=c]{90}{\parbox[c][0pt][c]{1cm}{\textbf{Source2}\\[20pt]}}}\par
% \hspace*{1cm}\MyHBox[\dimexpr5.1cm+6\fboxsep\relax]{Source1}\par
\hspace*{1cm}\MyHBox{LH}\MyHBox{RH}\MyHBox{Other contact}\par
\MyTBox{Type 0}{25}{0}{0}
\MyTBox{Type 1}{1}{43}{1}
\MyTBox{Undetected{0}{5}{-}
}
\end{document}
and it does not compile. It shows, Missing \endcsname inserted. error.
I would like to generate the figure above and, if possible, use tikz and standalone documentclass.


