log -log histogram, unequal bin sizes and bar edges
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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]);
![](https://www.mathworks.com/matlabcentral/images/broken_image.png)
I imagine that the histogram should look something like this, but with log scale.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/151145/image.png)
I appreciate any help I can get!
0 comentarios
Respuestas (1)
Image Analyst
el 19 de Feb. de 2013
I don't see that hist() takes an "edges" input argument. I think you want histc() instead.
2 comentarios
Image Analyst
el 19 de Feb. de 2013
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
Ver también
Categorías
Más información sobre Data Distribution Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!