import plotnine as pn from plotnine.data import mtcars pn.themes.theme_set(pn.themes.theme_bw()) mtcars = mtcars.assign(cyl=mtcars["cyl"].astype("category")) bench_geom_point = ( pn.ggplot(mtcars, pn.aes("wt", "mpg")) + pn.geom_point(pn.aes(colour="cyl")) + pn.theme_bw() ) for ext in ["eps", "png", "svg"]: bench_geom_point.save( filename=f"plotnine_geom_point.{ext}", format=ext, width=18, height=12, units="cm", )