@cleanup
def test_geom_abline_functions():
    df = _build_line_df()

    def sfunc(x, y):
        return (y.iloc[-1] - y.iloc[0]) / (x.iloc[-1] - x.iloc[0])

    def ifunc(x, y):
        return np.mean(y)
    gg = ggplot(df, aes(x='wt', y='mpg'))

    # Note, could have done intercept=np.mean
    gg = gg + geom_point() +  geom_abline(aes(x='wt', y='mpg'),
                                          slope=sfunc,
                                          intercept=ifunc)
    assert_same_ggplot(gg, 'geom_abline_functions')
dataset/ETHPy150Open yhat/ggplot/ggplot/tests/test_geom_lines.py/test_geom_abline_functions/original