def plot_rmse_vs_time(Ymes, Ypre, Time, Date, name):

    fw, fh = 6, 6
    fig = mpl.figure.Figure(figsize=(fw, fh), facecolor='white')
    canvas = FigureCanvas(fig)

    # ---- Create Axes

    leftMargin = 0.75 / fw
    rightMargin = 0.75 / fw
    bottomMargin = 0.75 / fh
    topMargin = 0.75 / fh

    x0, y0 = leftMargin, bottomMargin
    w0 = 1 - (leftMargin + rightMargin)
    h0 = 1 - (bottomMargin + topMargin)

    ax0 = fig.add_axes([x0, y0, w0, h0], polar=True)

    # ---- Plot Data

    # Estimation Error

    Yerr = np.abs(Ypre - Ymes)
    Time *= 2 * np.pi / 365.

    c = '0.4'
    ax0.plot(Time, Yerr, '.', mec=c, mfc=c, ms=15, alpha=0.5)

    # RMSE Polygon

    Months = Date[1]
    RMSE = np.zeros(12)
    mfd = np.zeros(12)
    for m in range(12):
        mfd[m] = (xldate_from_date_tuple((2000, m+1, 1), 0) -
                  xldate_from_date_tuple((2000, 1, 1), 0))
        indx = np.where(Months == m+1)[0]
        RMSE[m] = (np.mean(Yerr[indx] ** 2)) ** 0.5

    # Transform first day of the month to radians
    mfd = mfd * 2 * np.pi / 365.

    # Add first point at the end to close the polygon
    mfd = np.append(mfd, mfd[0])
    RMSE = np.append(RMSE, RMSE[0])
    ax0.plot(mfd, RMSE * 5, ls='--', c='red', lw=2, mec='b', mew=3, mfc='b',
             ms=10, dash_capstyle='round', dash_joinstyle='round')

    # ---- Labels

    ax0.tick_params(axis='both', direction='out', labelsize=16)
    ax0.set_xticklabels(['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN',
                         'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'])
    ax0.set_xticks(mfd)

    ax0.set_yticklabels([])
    ax0.set_yticks([])
    ax0.set_rmax(1.1 * np.max(Yerr))
    # ax0.set_rgrids([10,20,30,40,50,60,70,80,90], angle=345.)

    # ---- Draw

    fig.savefig(name + '_polar_error.pdf')
    canvas.show()