How do I create a 3D histogram for; x = 1*26, y=1*28, z = 26*28 ?
49 次查看(过去 30 天)
显示 更早的评论
I would basically like to bin the the 'z' data into ranges of x and y such as the attached picture:

回答(3 个)
Walter Roberson
2016-3-21
There are also a lot of histogram programs in the File Exchange.
2 个评论
Walter Roberson
2016-3-21
Do you need zooming and data tips? If not then see http://www.mathworks.com/matlabcentral/fileexchange/35274-matlab-plot-gallery-bar-graph-3d
If you do, then see for example http://www.mathworks.com/matlabcentral/fileexchange/45916-3d-colored-bar-plot
Image Analyst
2016-3-22
Aaron, give the x and y data as an N by 2 array, then pass in the number of bins in each direction into the poorly named hist3() to create your 2D histogram
counts = hist3([x, y], [26, 28]);
8 个评论
Image Analyst
2016-3-26
Well now you'r totally confusing everybody. We though that the x and y were basically ranges that your data could take. So one data point had both an x coordinate, and a y coordinate. And you wanted 28 bins along the y direction, and 26 bins along the x direction. And then "z" would be the counts of how many data points fell into a certain x,y bins. You don't have any z data yet, before taking the histogram, do you? It's to be computed and is the "count" data. If that's not right, then no one has read your mind correctly, and you'll need to explain better and attach your x, y, and z arrays.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Distribution Plots 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!