def choose_text_size(n_chars, boxsize=1.0):
    """
    Helper to choose an appropriate text size when plotting policies.  Size is chosen based on length of text

    Return is calibrated to something that typically looked nice in testing

    Args:
        n_chars: Text caption to be added to plot
        boxsize (float): Size of box inside which text should print nicely.  Used as a scaling factor.  Default is 1 inch

    Returns:
        Matplotlib-style text size argument
    """
    return min(40.0, 80.0 / n_chars) * boxsize