def MakeComparison(firsts, others):
 first_hist = thinkstats2.Hist(firsts.prglngth, label='first')
 other_hist = thinkstats2.Hist(others.prglngth, label='other')
 width = 0.45
 thinkplot.PrePlot(2)
 thinkplot.Hist(first_hist, align='right', width=width)
 thinkplot.Hist(other_hist, align='left', width=width)
 thinkplot.Save(root='first_nsfg_hist', title='Histogram', xlabel='weeks', ylabel='frequency', axis=[27, 46, 0, 2700])

def MakeComparison ( firsts , others ) : first_hist = thinkstats2 . Hist ( firsts . prglngth , label = 'first' ) other_hist = thinkstats2 . Hist ( others . prglngth , label = 'other' ) width = 0.45 thinkplot . PrePlot ( 2 ) thinkplot . Hist ( first_hist , align = 'right' , width = width ) thinkplot . Hist ( other_hist , align = 'left' , width = width ) thinkplot . Save ( root = 'first_nsfg_hist' , title = 'Histogram' , xlabel = 'weeks' , ylabel = 'frequency' , axis = [ 27 , 46 , 0 , 2700 ] )
plots histograms of pregnancy length for first babies and others .