display data value on pcolor
4 次查看(过去 30 天)
显示 更早的评论
% histogram
x = 0:0.1:3.5;
y = 2.5:2:40.5;
for i = 1:size(y,2);
z(i,:) = histc(mag_fit(i,:),x);
end
z = z/sum(z(i,:))*100 % percentage occurence at ceratin x and y
pcolor(x,y,z)
I have plotted a pcolor and I would like to show the z number in each cell. How could I possibly do that?
0 个评论
回答(1 个)
Image Analyst
2016-3-18
编辑:Image Analyst
2016-3-18
Not exactly sure what you want, especially since we can't run your code because you didn't supply mag_fit. Perhaps this is what you might like: http://www.mathworks.com/matlabcentral/fileexchange/32273-im2html-m by Steve Eddins, the leader of the imaging group at the Mathworks
Essentially, you can colormap any value into an RGB color and that value is displayed in a box of that color with the RGB values imprinted over it.
By the way, did you know pcolor leaves off the last row and last column? Prove it yourself and run this pcolor(rand(3,3)); and see if you get a 3 by 3 image (you won't).
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Modify Image Colors 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!