Plotnine which is almost in same style (> 90%) as ggplot2, claims to be an "implementation of a grammar of graphics in Python, it is based on ggplot2 and allows users to compose plots by explicitly mapping data to the visual objects that make up the plot". Below is a quick example from the new API page:
## Installation
Conda - "conda install -c conda-forge plotnine"
(or)
PIP - "pip install plotnine"
## quick example from API page
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'))
Those who have not yet experience this can try out now and let me know your experiences at mavuluri.pradeep@gmail.com
Happy R and Python Programming!
No comments:
Post a Comment