'Outputs the statistics for various time frames.'

def _plot_txt_time(self, stats, ax=None, **kwargs):

    def format_perc(x, pos):
        return ('%.0f%%' % x)
    returns = stats['returns']
    if (ax is None):
        ax = plt.gca()
    y_axis_formatter = FuncFormatter(format_perc)
    ax.yaxis.set_major_formatter(FuncFormatter(y_axis_formatter))
    mly_ret = perf.aggregate_returns(returns, 'monthly')
    yly_ret = perf.aggregate_returns(returns, 'yearly')
    mly_pct = (mly_ret[(mly_ret >= 0)].shape[0] / float(mly_ret.shape[0]))
    mly_avg_win_pct = np.mean(mly_ret[(mly_ret >= 0)])
    mly_avg_loss_pct = np.mean(mly_ret[(mly_ret < 0)])
    mly_max_win_pct = np.max(mly_ret)
    mly_max_loss_pct = np.min(mly_ret)
    yly_pct = (yly_ret[(yly_ret >= 0)].shape[0] / float(yly_ret.shape[0]))
    yly_max_win_pct = np.max(yly_ret)
    yly_max_loss_pct = np.min(yly_ret)
    ax.text(0.5, 8.9, 'Winning    Months    %', fontsize=8)
    ax.text(9.5, 8.9, '{:.0%}'.format(mly_pct), fontsize=8, fontweight='bold', horizontalalignment='right')
    ax.text(0.5, 7.9, 'Average    Winning    Month    %', fontsize=8)
    ax.text(9.5, 7.9, '{:.2%}'.format(mly_avg_win_pct), fontsize=8, fontweight='bold', color=('red' if (mly_avg_win_pct < 0) else 'green'), horizontalalignment='right')
    ax.text(0.5, 6.9, 'Average    Losing    Month    %', fontsize=8)
    ax.text(9.5, 6.9, '{:.2%}'.format(mly_avg_loss_pct), fontsize=8, fontweight='bold', color=('red' if (mly_avg_loss_pct < 0) else 'green'), horizontalalignment='right')
    ax.text(0.5, 5.9, 'Best    Month    %', fontsize=8)
    ax.text(9.5, 5.9, '{:.2%}'.format(mly_max_win_pct), fontsize=8, fontweight='bold', color=('red' if (mly_max_win_pct < 0) else 'green'), horizontalalignment='right')
    ax.text(0.5, 4.9, 'Worst    Month    %', fontsize=8)
    ax.text(9.5, 4.9, '{:.2%}'.format(mly_max_loss_pct), fontsize=8, fontweight='bold', color=('red' if (mly_max_loss_pct < 0) else 'green'), horizontalalignment='right')
    ax.text(0.5, 3.9, 'Winning    Years    %', fontsize=8)
    ax.text(9.5, 3.9, '{:.0%}'.format(yly_pct), fontsize=8, fontweight='bold', horizontalalignment='right')
    ax.text(0.5, 2.9, 'Best    Year    %', fontsize=8)
    ax.text(9.5, 2.9, '{:.2%}'.format(yly_max_win_pct), fontsize=8, fontweight='bold', color=('red' if (yly_max_win_pct < 0) else 'green'), horizontalalignment='right')
    ax.text(0.5, 1.9, 'Worst    Year    %', fontsize=8)
    ax.text(9.5, 1.9, '{:.2%}'.format(yly_max_loss_pct), fontsize=8, fontweight='bold', color=('red' if (yly_max_loss_pct < 0) else 'green'), horizontalalignment='right')
    ax.set_title('Time', fontweight='bold')
    ax.grid(False)
    ax.spines['top'].set_linewidth(2.0)
    ax.spines['bottom'].set_linewidth(2.0)
    ax.spines['right'].set_visible(False)
    ax.spines['left'].set_visible(False)
    ax.get_yaxis().set_visible(False)
    ax.get_xaxis().set_visible(False)
    ax.set_ylabel('')
    ax.set_xlabel('')
    ax.axis([0, 10, 0, 10])
    return ax
