Plotnine

Comments

Legends, labels, breaks, color palettes. Many elements are added automatically based on the data.

(
    ggplot(anscombe_quartet, aes("x", "y", color="dataset"))
    + geom_point()
)

By coloring each point according to the dataset it belongs to, the plot automatically gets a legend. The colors are chosen automatically as well. But don’t worry, as we’ll see later, everything can be adjusted.

It’s still rather messy, so let’s try a different approach.