from plotnine import (
ggplot,
aes,
geom_point,
scale_shape_manual,
)from plotnine.data import mtcars
Using letters as shapes
You can create shape symbols using \(\TeX\). For example
= (
mixed_shapes r"$\mathrm{A}$",
r"$\mathrm{B}$",
r"$\mathrm{C}$",
r"$\mathrm{D}$",
)
("wt", "mpg", shape="factor(gear)", colour="factor(gear)"))
ggplot(mtcars, aes(+ geom_point(size=6)
+ scale_shape_manual(values=mixed_shapes)
)
See matplotlib documentation for more.