Creating a Density Plot Using Plotnine

Python

 1|  import plotnine as p9
 2|  import pandas as pd
 3|  
 4|  df = pd.read_csv(sales_data.csv)
 5|  
 6|  print(p9.ggplot(df) + 
 7|        p9.aes(x='sales', fill='department') + 
 8|        p9.geom_density(alpha=0.5))
Did you find this snippet useful?

Sign up for free to to add this to your code library