import pandas as pd
from lets_plot import *
LetsPlot.setup_html()
mpg_df=pd.read_csv('https://raw.githubusercontent.com/JetBrains/lets-plot-docs/master/data/mpg.csv')
ggplot(mpg_df, aes(x='class')) + \
geom_bar(aes(fill='class'), alpha=.8) + \
scale_fill_discrete()
ggplot(mpg_df) + \
geom_bar(aes(x='cyl', fill='drv'), color='white', size=0.5)
ggplot(mpg_df) + \
geom_bar(aes(x='cyl', fill='drv'), position='dodge')
results = {'rating': [5, 4, 3, 4, 3, 4, 5, 3, 5, 3, 4, 3]}
ggplot(results, aes(x='rating')) + geom_bar(aes(y='..count..',fill='..count..'), width=0.85) + \
scale_fill_discrete()