def get_pie_size(val, verbose=False, getscale=False):
    """
    Get the size of the pie chart based on val.
    :param val: the value to test
    :param verbose: more output
    :param getscale: return the marker sizes regardless of val
    :return: the size of the marker in pixels
    """

    # these are the sizes of the pies
    # piesizes = [22, 25, 28, 31, 34]
    # piesizes = [15, 18, 21, 24, 27]
    # piesizes = [4, 9, 14, 19, 25]
    # piesizes = [13, 16, 19, 22, 25]
    # piesizes = [11, 14, 17, 20, 23]
    # piesizes = [9, 12, 15, 18, 21]
    # piesizes = [8, 11, 14, 17, 20]
    # piesizes = [6, 9, 12, 15, 18]
    # piesizes = [4, 6, 8, 10, 14]
    # piesizes = [2, 4, 6, 8, 12]
    # piesizes = [0.5, 1, 1.5, 2, 2.5]
    # piesizes = [0.5, 0.7, .9, 1.1, 1.3]
    piesizes = [0.5, 0.8, 1.1]

    # there should be one less maxpievals than piesizes and then we use piesizes[-1] for anything larger
    # maxpievals = [10, 20, 30, 40]
    maxpievals = [20, 40]

    if getscale:
        return piesizes

    for i,m in enumerate(maxpievals):
        if val <= m:
            return piesizes[i]
    return piesizes[-1]