I want to type the value of matrix elements when plotting it on the topside of the bar.
Example: $$M=\left(\begin{matrix} 0.77 & 0.04 & 0.01 & 0.0\\ 0.04 & 0.81 & 0.0 & 0.0\\ 0.02 & 0.0 & 0.81 & 0.08\\ 0.0 & 0.07 & 0.04 & 0.93 \end{matrix}\right)$$
the output:
my code:
exp1 = ( {
{0.77, 0.04, 0.01, 0.0},
{0.04, 0.81, 0.0, 0.0},
{0.02, 0.0, 0.81, 0.08},
{0.0, 0.07, 0.04, 0.93}
} )
data = ArrayPad[Abs[exp1], {0, 1}];
DATAAA1 =
ListPlot3D[data, Mesh -> Full, InterpolationOrder -> 0,
Filling -> Bottom, FillingStyle -> {Opacity[0.7]},
ColorFunction -> "IslandColors", PlotRange -> All,
BoxRatios -> {1, 1, 1}, DataRange -> All, ImageSize -> 600,
PlotTheme -> "Monochrome",
PlotStyle -> Directive[Opacity[0.9], Blue],
AxesLabel -> {Text[Rotate["Input", -10 Degree]],
Text[Rotate["Output", 60 Degree]],
Text[Rotate["Probability", 100 Degree]]},
LabelStyle -> Directive[Black, Thick, 12], Boxed -> False]
Edit
There are complicated solutions that manually construct a Graphics3D object, but can there be a simple solution using standard functions?
Edit 2
I found a manual solution using the following latex code
\documentclass[]{article}
\usepackage{lipsum}
\usepackage{pgfplots}
\pgfplotsset{compat=1.15}
\usepackage[a4paper, total={17cm, 25cm}]{geometry}
\begin{document}
\begin{figure}\centering
\setlength{\unitlength}{0.085mm}
\begin{picture}(800,250)\linethickness{0.3mm}
\includegraphics[width=5cm,height=5cm]{sample.eps}
\put(-490,380){\scriptsize$0.77$}
\put(-350,410){\scriptsize$0.81$}
\put(-220,430){\scriptsize$0.81$}
\put(-90,490){\scriptsize$0.93$}
\end{picture}
\end{figure}
\end{document}
the output:
but I am still searching for an automated way on Mathematica to solve the problem.



Histogram3Ddocumentation, in particular Options/ChartLabels. There are good examples. – yarchik Oct 19 '21 at 10:46rest = exp1 - DiagonalMatrix[Diagonal[exp1]]; r = Flatten[Table[n = Round[rest[[i, j]]*100]; ConstantArray[{i, j}, n] , {i, 4}, {j, 4}], 2]; d = Table[n = Round[exp1[[i, i]]*100]; ConstantArray[{i, i}, n], {i, 4}]; Histogram3D[Join[d, {r}], Automatic, "Probability", PlotRange -> All, ChartLabels -> Placed[Diagonal[exp1], Above, "Framed"], PlotTheme -> {"Marketing", "NoAxes"}]– yarchik Oct 19 '21 at 20:15