log -log histogram, unequal bin sizes and bar edges
4 ビュー (過去 30 日間)
古いコメントを表示
Hi, I want to create a loglog histogram with unequal bin size (see the histogram in the lower right of the picture below). The problem is that the width of the bars change and don't connect with each other, ie the edges of the bars do not show the bin size. Is there a way to do this? The histogram (lower-right) was created with the following code
edges=[1 2 3 4 5 10 20 40 60 80 1e2 2e2 4e2 6e2 8e2 1e3 2e3 4e3 6e3 8e3 1e4 2e4 4e4 5e5];
[binvals1]=histc(RTtrue_info(:,2),edges);
h1=barh(edges,(binvals1),'parent',axes3,'facecolor',[0.6 0.6 0.6],'edgecolor',[0.6 0.6 0.6]);
set(h1,'barwidth',0.4);
hold off
set(axes3,...
'ylim',[y_padding1 1e5],...
'xlim',[0 1e5],...
'xscale','log',...
'yscale','log',...
'yticklabel',{},...
'xtick',[1e0 1e1 1e2 1e3 1e4]);
I imagine that the histogram should look something like this, but with log scale.
I appreciate any help I can get!
0 件のコメント
回答 (1 件)
Image Analyst
2013 年 2 月 19 日
I don't see that hist() takes an "edges" input argument. I think you want histc() instead.
2 件のコメント
Image Analyst
2013 年 2 月 19 日
You can supply data if you want people to try something: http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers
参考
カテゴリ
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!