colormap for a matrix

69 次查看(过去 30 天)
MiauMiau
MiauMiau 2017-12-10
Given a matrix:
0 0.0104 0.0027
0.0104 0 0.0163
0.0027 0.0163 0.0000
I am using imagesc(corrData). However I would like to only have the integers displayed on x- and y-axis ("1","2" and "3"). How can I accomplish that?

采纳的回答

Image Analyst
Image Analyst 2017-12-10
Use xticks and yticks():
m = [ 0 0.0104 0.0027
0.0104 0 0.0163
0.0027 0.0163 0.0000]
imagesc(m);
axis on;
xticks(1:size(m, 2));
yticks(1:size(m, 1));
  2 个评论
MiauMiau
MiauMiau 2017-12-10
Thanks! A quick other question: How can I change the colormap I want to use?
Image Analyst
Image Analyst 2017-12-10
cmap = hsv(256); % Or whatever function you want like jet(), hot(), autumn(), etc.
colorbar(gca, cmap);

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Orange 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by