You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bar plot function seems to ignore bar heights that are zero. For example, the data set called "freq1" does not contain a leading zero and the bar heights are correct. The data set "freq2" contains a leading zeros, both of which are ignored in the bar plot.
import pylab
import numpy as np
faces = np.array(range(11)) # the histogram bin faces
left_face = faces[:-1] # the left side face of the cell
bin_width = faces[1:]-faces[:-1]
freq1 = [-2,0,3,4,5,6,7,8,9,12]
freq2 = [0,0,3,4,5,6,7,8,9,12] # error with this data set
pylab.bar(left_face, freq1, width=bin_width)
pylab.show()
pylab.bar(left_face, freq2, width=bin_width)
pylab.show()