In Plotnine, is it possible to hide certain legend elements?
mpg_select = mpg[mpg["manufacturer"].isin(pd.Series(["audi", "ford", "honda", "hyundai"]))]
I have selected only 4 manufacturers. But when I plot the data, I still see the manufacturers that are not in the data as elements for my legend.
(ggplot(mpg_select, aes(x="displ", y="cty"))
+ geom_jitter(aes(size="hwy", color="manufacturer"))
+ geom_smooth(aes(color="manufacturer"), method="lm", se=False)
+ labs(title="Bubble chart")
)
How do I show only the manufacturer that I selected (audi, ford, honda, and hyundai) as my legend?