I am currently running into a couple errors when attempting to plot an abline for different facets. The first error involves not being able to set different slopes for different facets. The second error involves facet variables being reserved names.
Below is a reproducible example under version 0.4.0:
import plotnine as p9
import pandas as pd
df = pd.DataFrame({'list':['a','a','b','b'], 'x':[1,2,3,4], 'y':[1,2,6,8]})
df['category'] = df['list']
df_slope = pd.DataFrame({'category':['a','b'], 'intercept':[0,0], 'slope':[1,2]})
print(p9.__version__)
Plotting points with a facet works as expected:
(p9.ggplot(df, p9.aes(x='x', y='y')) +
p9.geom_point() +
p9.facet_wrap('~category'))

Attempting to plot an abline with a facet throws an error.
(p9.ggplot(df_slope, p9.aes(intercept='intercept', slope='slope')) +
p9.geom_abline() +
p9.facet_wrap('~category'))

Attempting to plot both points and an abline does not throw an error, but it doesn't take the specified slope of 2 for facet b:
(p9.ggplot(df, p9.aes(x='x', y='y')) +
p9.geom_point() +
p9.geom_abline(mapping=p9.aes(intercept='intercept', slope='slope'),
data=df_slope) +
p9.facet_wrap('~category'))

Finally, there is another error that I'm getting when the name of the facet variable is reserved. When the variable is not reserved, everything works:
(p9.ggplot(df, p9.aes(x='x', y='y')) +
p9.geom_point() +
p9.geom_abline(intercept=0, slope=1) +
p9.facet_wrap('~category'))

When the facet variable is reserved, I get another error:
(p9.ggplot(df, p9.aes(x='x', y='y')) +
p9.geom_point() +
p9.geom_abline(intercept=0, slope=1) +
p9.facet_wrap('~list'))

It seems like this issue has come up in the past, but it was thought to be fixed (#48).
I am currently running into a couple errors when attempting to plot an
ablinefor different facets. The first error involves not being able to set different slopes for different facets. The second error involves facet variables being reserved names.Below is a reproducible example under version 0.4.0:
Plotting
pointswith a facet works as expected:Attempting to plot an
ablinewith a facet throws an error.Attempting to plot both
pointsand anablinedoes not throw an error, but it doesn't take the specified slope of2for facetb:Finally, there is another error that I'm getting when the name of the facet variable is reserved. When the variable is not reserved, everything works:
When the facet variable is reserved, I get another error:
It seems like this issue has come up in the past, but it was thought to be fixed (#48).