def pairs(csv, keys, skip=0):
    """Create a pairs plot for keys in the given dataset.
    """
    import pylab as pl
    n = len(keys)
    if isinstance(csv, dict):
        csv = [csv]
    for i, key_i in enumerate(keys):
        for j, key_j in enumerate(keys):
            pl.subplot(n, n, i * n + j + 1)
            for csvi in csv:
                if i == j:
                    pl.hist(csvi[key_i][skip:], 20, log=True)
                else:
                    pl.plot(csvi[key_j][skip:], csvi[key_i][skip:], '.')
            if i == 0:
                pl.title(key_j)
            if j == 0:
                pl.ylabel(key_i)
