display data value on pcolor

조회 수: 4 (최근 30일)
Ed Chan
Ed Chan 2016년 3월 18일
편집: Ed Chan 2016년 3월 18일
% 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?

답변 (1개)

Image Analyst
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).
  댓글 수: 1
Ed Chan
Ed Chan 2016년 3월 18일
편집: Ed Chan 2016년 3월 18일
Sorry. mag_fit is the speed data. Please see attached. I am trying to put the speed into bins and calculate z as the % occurrence in each level of height. As the colour is showing the %, it would be clearer if the exact % of cell can overlay on top of the colour

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Modify Image Colors에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by