Reading the paper Measuring Wigner functions of quantum states of light in the undergraduate laboratory in arXiv, I found the figure above, whose style is very beautiful. I tried to reproduce it, but I failed. Is there an elegant method to obtain a similar style of bar chart?
code:
alpha = 2;
rho[m_, n_] := Exp[-Abs[alpha]^2] alpha^n Conjugate[alpha]^m/Sqrt[n! m!]
matrix = Table[rho[m,n],{m,1,20},{n,1,20}];
MatrixPlot[matrix]
I don't know how to plot a 3d bar chart using a matrix, because my data is created by numerical calculation. I found some example in StackExange, but there the data has n * 5 dimensions.
Through trying, I found the following ways to achieve my requirements, thank you all. The effect has not yet been fully reproduced, I will continue to work hard.
revised code version:
alpha=2;
rho[m_,n_]:=Exp[-Abs[alpha]^2] alpha^n Conjugate[alpha]^m/Sqrt[n! m!]
matrix=Table[rho[m,n],{m,1,20},{n,1,20}];
DiscretePlot3D[Abs[matrix[[m,n]]],{m,1,20},{n,1,20},ExtentSize->Full,
ColorFunction->Function[{x,y,z},ColorData["TemperatureMap"]z]],
ColorFunctionScaling->True,BoxRatios->{1, 1, 0.618},Boxed->False]
DiscretePlot3D
for which you would need an expression to plot. $\endgroup$