Axis numbers on histogram
Show older comments
Hello there,
I'm trying to plot a histogram plot of departure times on the 24-hour time scale.
Here is an example of what I'm trying to achieve: http://img593.imageshack.us/img593/3032/depaturetime.jpg
My question is: How can I get the x-axis to start at 5am and finish at 4am like it is in the example. When I plot it it goes from 0 - 24.
Also how could I plot the cumulative distribution over the histogram.
My code:
DepartureTimes = load('Departure Times.txt')
h = hist(DepartureTimes,24);
h = h/sum(h);
bar(h, 'DisplayName', 'Depature Times');
legend('show');
Many thanks for your help
John
Accepted Answer
More Answers (1)
Image Analyst
on 7 Jan 2012
0 votes
Did you try xlim()?
Categories
Find more on Histograms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!