def linebreaker(i, break_pt=16, sep=' '):
    """
    used for adding labels in plots.

    :param l: list of strings
    :param break_pt: number, insert new line after this many letters 
    """
    if len(i) > break_pt:
        i_words = i.split(sep)
        i_out = ''
        line_len = 0
        for w in i_words:
            line_len += len(w) + 1
            if i_words.index(w) == 0:
                i_out = w
            elif line_len > break_pt:
                line_len = 0
                i_out = '%s\n%s' % (i_out, w)
            else:
                i_out = '%s %s' % (i_out, w)
        return i_out
    else:
        return i
