How to plot matrix to color band
4 次查看(过去 30 天)
显示 更早的评论
I have such a matrix
X=[1, 2, 1, 3, 2, 1, 4, 2, 1, 3 ;...
2, 1, 1, 3, 6, 2, 4, 3, 2, 1;...
4, 1, 7, 2, 4, 3, 2, 4, 1, 2;...
2, 1, 5, 7, 5, 6, 7, 1, 2, 3];
And I want to plot it like this
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1078185/image.png)
ofcourse with axis and colorbar
It is posible to do that?
0 个评论
采纳的回答
Abderrahim. B
2022-7-26
编辑:Abderrahim. B
2022-7-26
X=[1, 2, 1, 3, 2, 1, 4, 2, 1, 3 ;...
2, 1, 1, 3, 6, 2, 4, 3, 2, 1;...
4, 1, 7, 2, 4, 3, 2, 4, 1, 2;...
2, 1, 5, 7, 5, 6, 7, 1, 2, 3];
heatmap(X, 'CellLabelColor', 'none')
colormap(flipud(gray))
colorbar
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!