Esempio n. 1
0
def _make_line_plot(age_bins):
    xs = []
    ys = []
    for bin, weights in sorted(age_bins.iteritems()):
        xs.append(bin)
        ys.append(_03_thinkstats._mean(weights))

    _05_myplot._plot(xs, ys, 'bs-')
    _05_myplot._save(root='agemodel_line',
                     xlabel="Mother's age (years)",
                     ylabel='Mean birthweight (oz)',
                     legend=False)
Esempio n. 2
0
def main():
    xs, ys = _render_pdf(100, 15)
    n = 34
    pyplot.fill_between(xs[-n:], ys[-n:], y2=0.0001, color='blue', alpha=0.2)
    s = 'Congratulations!\nIf you got this far,\nyou must be here.'
    d = dict(shrink=0.05)
    pyplot.annotate(s, [127, 0.02], xytext=[80, 0.05], arrowprops=d)

    _05_myplot._plot(xs,
                     ys,
                     clf=False,
                     show=True,
                     title='Distribution of IQ',
                     xlabel='IQ',
                     ylabel='PDF',
                     legend=False)