Azzera filtri
Azzera filtri

log -log histogram, unequal bin sizes and bar edges

2 visualizzazioni (ultimi 30 giorni)
Filip
Filip il 19 Feb 2013
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!

Risposte (1)

Image Analyst
Image Analyst il 19 Feb 2013
I don't see that hist() takes an "edges" input argument. I think you want histc() instead.

Community Treasure Hunt

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

Start Hunting!

Translated by