def plot_returns(perf_attrib_data, cost=None, ax=None):
if ax is None:<EOL><INDENT>ax = plt.gca()<EOL><DEDENT>returns = perf_attrib_data['<STR_LIT>']<EOL>total_returns_label = '<STR_LIT>'<EOL>cumulative_returns_less_costs = _cumulative_returns_less_costs(<EOL>returns,<EOL>cost<EOL>)<EOL>if cost is not None:<EOL><INDENT>total_returns_label += '<STR_LIT>'<EOL><DEDENT>specific_returns = perf_attrib_data['<STR_LIT>']<EOL>common_returns = perf_attrib_data['<STR_LIT>']<EOL>ax.plot(cumulative_returns_less_costs, color='<STR_LIT:b>',<EOL>label=total_returns_label)<EOL>ax.plot(ep.cum_returns(specific_returns), color='<STR_LIT:g>',<EOL>label='<STR_LIT>')<EOL>ax.plot(ep.cum_returns(common_returns), color='<STR_LIT:r>',<EOL>label='<STR_LIT>')<EOL>if cost is not None:<EOL><INDENT>ax.plot(-ep.cum_returns(cost), color='<STR_LIT:k>',<EOL>label='<STR_LIT>')<EOL><DEDENT>ax.set_title('<STR_LIT>')<EOL>ax.set_ylabel('<STR_LIT>')<EOL>configure_legend(ax)<EOL>return ax<EOL>
Plot total, specific, and common returns.

Parameters
----------
perf_attrib_data : pd.DataFrame
    df with factors, common returns, and specific returns as columns,
    and datetimes as index. Assumes the `total_returns` column is NOT
    cost adjusted.
    - Example:
                    momentum  reversal  common_returns  specific_returns
        dt
        2017-01-01  0.249087  0.935925        1.185012          1.185012
        2017-01-02 -0.003194 -0.400786       -0.403980         -0.403980

cost : pd.Series, optional
    if present, gets subtracted from `perf_attrib_data['total_returns']`,
    and gets plotted separately

ax :  matplotlib.axes.Axes
    axes on which plots are made. if None, current axes will be used

Returns
-------
ax :  matplotlib.axes.Axes