plotnine.readthedocs.io - plotnine 0.13.3 - A Grammar of Graphics for Python

Example domain paragraphs

plotnine is an implementation of a grammar of graphics in Python based on ggplot2 . The grammar allows you to compose plots by explicitly mapping variables in a dataframe to the visual objects that make up the plot.

Plotting with a grammar of graphics is powerful. Custom (and otherwise complex) plots are easy to think about and build incremently, while the simple plots remain simple to create.

from plotnine import ggplot , geom_point , aes , stat_smooth , facet_wrap from plotnine.data import mtcars ( ggplot ( mtcars , aes ( "wt" , "mpg" , color = "factor(gear)" )) + geom_point () + stat_smooth ( method = "lm" ) + facet_wrap ( "~gear" )) Documentation ¶ API Reference Installation Gallery Changelog About plotnine Tutorials Glossary of Common Terms External Resources Back to top Source

Links to plotnine.readthedocs.io (7)