code: def plot_annual_returns(returns, ax=None, **kwargs):
      
  
      if ax is None:
          ax = plt.gca()
  
      x_axis_formatter = FuncFormatter(utils.percentage)
      ax.xaxis.set_major_formatter(FuncFormatter(x_axis_formatter))
      ax.tick_params(axis='x', which='major')
  
      ann_ret_df = pd.DataFrame(
          ep.aggregate_returns(
              returns,
              'yearly'))
  
      ax.axvline(
          100 *
          ann_ret_df.values.mean(),
          color='steelblue',
          linestyle='--',
          lw=4,
          alpha=0.7)
      (100 * ann_ret_df.sort_index(ascending=False)
       ).plot(ax=ax, kind='barh', alpha=0.70, **kwargs)
      ax.axvline(0.0, color='black', linestyle='-', lw=3)
  
      ax.set_ylabel('Year')
      ax.set_xlabel('Returns')
      ax.set_title("Annual returns")
      ax.legend(['Mean'], frameon=True, framealpha=0.5)
      return ax
docs: Plots a bar graph of returns by year.
  
      Parameters
      ----------
      returns : pd.Series
          Daily returns of the strategy, noncumulative.
           - See full explanation in tears.create_full_tear_sheet.
      ax : matplotlib.Axes, optional
          Axes upon which to plot.
      **kwargs, optional
          Passed to plotting function.
  
      Returns
      -------
      ax : matplotlib.Axes
          The axes that were plotted on.