def subplot_shape(size):
    """
    Get the most square shape for the plot axes values.
    If only one factor, increase size and allow for empty slots.
    """
    facts = [[i, size//i] for i in range(1, int(size**0.5) + 1) if size % i == 0]
    # re-calc for prime numbers larger than 3 to get better shape
    while len(facts) == 1:
        size += 1
        facts = [[i, size//i] for i in range(1, int(size**0.5) + 1) if size % i == 0]

    sum_facts = [sum(i) for i in facts]
    smallest = min(sum_facts)
    shape = facts[sum_facts.index(smallest)]
    
    return shape