def format_legend(plot, text_color):
    """Moves legend to the upper left of the plot area with no padding, and sets
    the text color.

    Args:
        plot: matplotlib.AxesSubplot object.
        text_color: matplotlib RGB color tuple.
    """
    legend = plot.legend(loc='upper left', borderaxespad=0)
    for text in legend.get_texts():
        text.set_color(text_color)
    return plot