Designed for composing lists of strings suitable for pyplot axis labels

    Often the xtick spacing doesn't allow room for 100's of text labels, so this
    eliminates every other one, then every other one of those, until they fit.

    >>> thin_string_list(['x']*20, 5)  # doctring: +NORMALIZE_WHITESPACE
    ['x', '', '', '', 'x', '', '', '', 'x', '', '', '', 'x', '', '', '', 'x', '', '', '']

def thin_string_list(list_of_strings, max_nonempty_strings=50, blank=''):
    """Designed for composing lists of strings suitable for pyplot axis labels

    Often the xtick spacing doesn't allow room for 100's of text labels, so this
    eliminates every other one, then every other one of those, until they fit.

    >>> thin_string_list(['x']*20, 5)  # doctring: +NORMALIZE_WHITESPACE
    ['x', '', '', '', 'x', '', '', '', 'x', '', '', '', 'x', '', '', '', 'x', '', '', '']
    """
        # blank some labels to make sure they don't overlap
    list_of_strings = list(list_of_strings)
    istep = 2
    while sum(bool(s) for s in list_of_strings) > max_nonempty_strings:
        list_of_strings = [blank if i % istep else s for i, s in enumerate(list_of_strings)]
        istep += 2
    return list_of_strings