Axis numbers on histogram
Ältere Kommentare anzeigen
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
Akzeptierte Antwort
Weitere Antworten (1)
Image Analyst
am 7 Jan. 2012
0 Stimmen
Did you try xlim()?
Kategorien
Mehr zu Histograms finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!