'Plots the underwater curve'

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

    def format_perc(x, pos):
        return ('%.0f%%' % x)
    drawdown = stats['drawdowns']
    if (ax is None):
        ax = plt.gca()
    y_axis_formatter = FuncFormatter(format_perc)
    ax.yaxis.set_major_formatter(FuncFormatter(y_axis_formatter))
    ax.yaxis.grid(linestyle=':')
    ax.xaxis.set_tick_params(reset=True)
    ax.xaxis.set_major_locator(mdates.YearLocator(1))
    ax.xaxis.set_major_formatter(mdates.DateFormatter('%Y'))
    ax.xaxis.grid(linestyle=':')
    underwater = ((-100) * drawdown)
    underwater.plot(ax=ax, lw=2, kind='area', color='red', alpha=0.3, **kwargs)
    ax.set_ylabel('')
    ax.set_xlabel('')
    plt.setp(ax.get_xticklabels(), visible=True, rotation=0, ha='center')
    ax.set_title('Drawdown    (%)', fontweight='bold')
    return ax
