Plotting a table with text inside
Show older comments
Hello
I am trying to plot a table with specific sizes, the resulted graph is either pcolor or contourf, but I require additional information to be shown in the field alongside with specified axis range and intervals.
the code I am using is of the form
xb = [3:1:13];
yb=[0.5:0.5:5.5];
data=[0,0,0,0,0,0,0,0,0,0,0;
0,49,73,85,86,83,78,82,67,63,59;
54,136,193,205,196,182,167,153,142,132,123;
106,265,347,347,322,294,265,244,224,207,193;
175,429,522,499,457,412,372,337,312,288,267;
262,600,600,600,600,540,484,442,399,367,340;
0,0,0,0,0,0,0,0,0,0,0;
0,0,0,0,0,0,0,0,0,0,0;
0,0,0,0,0,0,0,0,0,0,0;
0,0,0,0,0,0,0,0,0,0,0;
0,0,0,0,0,0,0,0,0,0,0;]
% analysis
bins=[11,11];
n =hist3(data,bins);
plotting
figure
pcolor(xb,yb,data),colorbar
I would like to replicate and insert the values as shown in figure 1 to the second figure.

Is there a way to import my data so as to be shown in the final figure as numbers on top of the color?
I found a very useful script in the exchange section although unfortunately it does not completely suits the figure output I want since it includes values that I wish not to be shown. but it may be useful to others http://uk.mathworks.com/matlabcentral/fileexchange/15877-heat-maps-with-text
thank you in advance
Accepted Answer
More Answers (1)
Image Analyst
on 25 Jan 2015
0 votes
Use image() or imshow() instead of pcolor(). pcolor() chops off the last row and last column. Then use text() like Geoff shows.
1 Comment
Image Analyst
on 25 Jan 2015
The application reminds me of the color frequency image: http://www.mathworks.com/matlabcentral/fileexchange/28164-color-frequency-image
Categories
Find more on Data Distribution Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!