I've a similar solution using caption
:
\usepackage{caption}
where in a beamer slide I would add caption via:
\captionof{figure}{\textbf{Confusion Matrix}}
as in:
\begin{frame}[fragile]
\frametitle{Confusion Matrix}
\begin{tikzpicture}[
box/.style={draw,rectangle,minimum size=2cm,text width=1.5cm,align=left}]
\matrix (conmat) [row sep=.1cm,column sep=.1cm] {
\node (tpos) [box,
label=left:\( \mathbf{p'} \),
label=above:\( \mathbf{p} \),
] {True \\ positive};
&
\node (fneg) [box,
label=above:\textbf{n},
label=above right:\textbf{total},
label=right:\( \mathrm{P}' \)] {False \\ negative};
\\
\node (fpos) [box,
label=left:\( \mathbf{n'} \),
label=below left:\textbf{total},
label=below:P] {False \\ positive};
&
\node (tneg) [box,
label=right:\( \mathrm{N}' \),
label=below:N] {True \\ negative};
\\
};
\node [left=.05cm of conmat,text width=1.5cm,align=right] {\textbf{actual \\ value}};
\node [above=.05cm of conmat] {\textbf{prediction outcome}};
\end{tikzpicture}
\captionof{figure}{\textbf{Confusion Matrix}}
\end{frame}
Preview

Simplified
For readability, without tikz
code:
\begin{frame}[fragile]
\frametitle{Confusion Matrix}
\begin{tikzpicture}[
% ... tikz ...
\end{tikzpicture}
\captionof{figure}{\textbf{Confusion Matrix}}
\end{frame}
The confusion matrix code comes from this answer.
figure
s with a running counter or just some text below it? You self-answer lets me goes it's the second case. In the first case should the pictures be labeled on their own, independent from the figures?caption
is because I googled and found that. I thought it was similar to a caption for a picture. There are two pictures being drawn next to each other, so I think the text solution is easier to manage in this particular situation. Nonetheless, I would agree with you on the first solution for a truecaption
for a picture.