def points(ys, width=None):
if width is None:<EOL><INDENT>width = terminal.width()<EOL><DEDENT>ys = np.array(ys)<EOL>n = len(ys)<EOL>y_min, y_max = np.min(ys), np.max(ys)<EOL>n_bins = min(width, n)<EOL>bins_per_n = float(n_bins) / float(n)<EOL>sums = np.zeros(n_bins)<EOL>counts = np.zeros(n_bins)<EOL>for i, y in enumerate(ys):<EOL><INDENT>bin = int(i * bins_per_n)<EOL>sums[bin] += y<EOL>counts[bin] += <NUM_LIT:1><EOL><DEDENT>bin_means = sums / counts<EOL>bin_heights = normalize(bin_means)<EOL>bin_chars = (bin_heights * (len(terminal.bars) - <NUM_LIT:1>)).astype(int)<EOL>cells = [terminal.bars[bin_char] for bin_char in bin_chars]<EOL>print('<STR_LIT>' % y_max)<EOL>print('<STR_LIT>'.join(cells))<EOL>print('<STR_LIT>' % y_min)<EOL>
Usage:
    import scipy.stats
    def walk(steps, position=0):
        for step in steps:
            position += step
            yield position
    positions = list(walk(scipy.stats.norm.rvs(size=1000)))
    points(positions)