stochastic programsprobabilityand statistics distributions histogram is plot designed to show the distribution of values in set of data the values are first sortedand then divided into fixed number of equalwidth bins plot is then drawn that shows the number of elements in each bin considerfor examplethe code vals [ #guarantee that values will range from to for in range( )num random choice(range( )num random choice(range( )vals append(num +num pylab hist(valsbins the function call pylab hist(valsbins produces the histogramwith ten binson the left pylab has automatically chosen the width of each bin looking at the codewe know that the smallest number in vals will be and the largest number thereforethe possible values on the -axis range from to each bin represents an equal fraction of the values on the xaxisso the first bin will contain the elements - the next bin the elements - etc since the mean values chosen for num and num will be in the vicinity of it is not surprising that there are more elements in the middle bins than in the bins near the edges by now you must be getting awfully bored with flipping coins neverthelesswe are going to ask you to look at yet one more coin-flipping simulation the simulation in figure illustrates more of pylab' plotting capabilities and gives us an opportunity to get visual notion of what standard deviation means the simulation uses the function pylab xlim to control the extent of the -axis the function call pylab xlim(returns tuple composed of the minimal and maximal values of the -axis of the current figure the function call pylab xlim(xminxmaxsets the minimal and maximal values of the -axis of the current figure the function pylab ylim works the same way