Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

plotting a cdf over a histogram

Asked by John on 30 Mar 2012

Hello,

I've plotted a histogram of some data. Here it is http://dl.dropbox.com/u/54057365/All/departure%20time.JPG

How would I plot a cumulative distribution curve over the histogram? Also why is there gaps between the bars?

I'm trying to a achieve a graph like this

http://img593.imageshack.us/img593/3032/depaturetime.jpg

Many thanks

DepartureTimes = load('Departure Times (hr).txt')
h = hist(DepartureTimes,24); 
h = h/sum(h); 
bar(h, 'DisplayName', 'Depature Times'); 
legend('show');
xlim([5 25])

0 Comments

John

Tags

Products

No products are associated with this question.

1 Answer

Answer by Thomas on 30 Mar 2012

try

hold on
cdfplot(h)

0 Comments

Thomas

Contact us