x = [1: 1000]
hist(x)
then, there are figure showing the histogram, but if i set the axes property and Y-axis to log. I cannot see anything in the figure. How to plot the histogram with log scale.
Try set(gca, 'Xscale', 'log')
for plotting log on X axis. It worked for me I am using 7.12.0 or 2011a. Check the axis reference for more help.
I would suggest using histc with log edges and barplot
help histc
-- Function File: N = histc (Y, EDGES)
matlab> edges=log(1:100:1000);
matlab> h=histc(x,edges)
matlab> bar(1:100:1000, h)
As far as I know, it's not available as a native matlab function:
http://www.mathworks.com/support/solutions/en/data/1-2ZUTKK/?solution=1-2ZUTKK
But this article also explains several workarrounds.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With