Closed julian-urbano closed 6 months ago
This is a bug. Using a list with a single string should be just about equivalent to using repr
string expressions. e.g.
(ggplot(df, aes(x='x'))
+ geom_point(aes(y='y', color='"Treatment"'))
+ geom_point(aes(y='z', color='"Control"'))
)
In-place use of scalars in
aes
is very handy, for instance to use constants or to easily differentiate groups:In the past (at least 0.10.1), we could also use string scalars, for example to use different colors for different datasets and have plotnine generate the mapping and scale for us:
But I'm afraid that this doesn't work anymore (0.12.4), nor does it work when giving a full list of values, as big as the dataframe (ie.
color=np.repeat('Treatment',3)
: