Chr*_*anM 3 matplotlib pgf julia
从我的计算中,我获得了一个二维实数数组。我想要对它们做的是将它们绘制为图像,其中数组元素的值转换为颜色图。到目前为止,我使用 PyPlot 包进行这种可视化。使用 Pyplot 这非常容易。使用灰度值的一个例子是
using PyPlot
test = rand(3,3);
PyPlot.gray()
imshow(test,interpolation="none")
colorbar()
Run Code Online (Sandbox Code Playgroud)
有没有办法做同样的事情,但使用 PGFPlots 包而不是 PyPlot?我已经尝试过使用 Plots.Image 但这不适用于数组而不是函数。有任何想法吗?
或者
using Plots; pgfplots()
test = randn(3,3)
heatmap(test, c = :greys)
Run Code Online (Sandbox Code Playgroud)