'Plot prediction.
.. note:: Uses `matplotlib <http://matplotlib.sourceforge.net/>`_.
Parameters
xscale, yscale : {\'linear\', \'log\', \'symlog\'}
Scaling for `matplotlib.axes.Axes`.
xlabeltext : str, optional
Text for X-label.
save_as : str, optional
Save plot as given filename.
Raises
RuntimeError
Insufficient data for plotting.'

def plot(self, xscale=u'linear', yscale=u'linear', xlabeltext=u'args', save_as=u''):

    import matplotlib.pyplot as plt
    x_arr = sorted(self._cache_good)
    y_arr = np.array([self._cache_good[x] for x in x_arr])
    if (len(x_arr) <= 1):
        raise RuntimeError(u'insufficient    data    for    plotting')
    qmean = (y_arr.mean() * u.second)
    for cur_u in (u.minute, u.second, u.millisecond, u.microsecond, u.nanosecond):
        val = qmean.to_value(cur_u)
        if (1000 > val >= 1):
            break
    y_arr = (y_arr * u.second).to_value(cur_u)
    (fig, ax) = plt.subplots()
    ax.plot(x_arr, y_arr, u'kx-', label=u'Actual')
    if (self._fit_func is not None):
        x_est = list(six.iterkeys(self._cache_est))
        y_est = (np.array(list(six.itervalues(self._cache_est))) * u.second).to_value(cur_u)
        ax.scatter(x_est, y_est, marker=u'o', c=u'r', label=u'Predicted')
        x_fit = np.array(sorted((x_arr + x_est)))
        y_fit = (self._fit_func((x_fit ** self._power)) * u.second).to_value(cur_u)
        ax.plot(x_fit, y_fit, u'b--', label=u'Fit')
    ax.set_xscale(xscale)
    ax.set_yscale(yscale)
    ax.set_xlabel(xlabeltext)
    ax.set_ylabel(u'Run    time    ({})'.format(cur_u.to_string()))
    ax.set_title(self._funcname)
    ax.legend(loc=u'best', numpoints=1)
    plt.draw()
    if save_as:
        plt.savefig(save_as)
