Plotnine and sample data sets from statsmodels

Python
Published

January 15, 2024

import statsmodels.api as sm
cars = sm.datasets.get_rdataset("cars")["data"]
from plotnine import ggplot, aes, geom_point
p = ggplot(cars, aes("speed", "dist")) + geom_point()
# p.save("test.pdf", width = 24, height = 24)
p
<Figure Size: (640 x 480)>