stat_summary()¶import numpy as np
import pandas as pd
from lets_plot import *
LetsPlot.setup_html()
df = pd.read_csv("https://raw.githubusercontent.com/JetBrains/lets-plot-docs/master/data/mpg.csv")
print(df.shape)
df.head()
ggplot(df, aes("drv", "hwy")) + stat_summary()
geom Parameter¶ggplot(df, aes("cty", "hwy")) + stat_summary(geom='smooth')
fun Parameter¶ggplot(df, aes("drv", "hwy")) + stat_summary(geom='bar', fun='count')
quantiles Parameter¶ggplot(df, aes("drv", "hwy")) + stat_summary(fun='mq', fun_min='lq', fun_max='uq', quantiles=[.45, .5, .55])
ggplot(df, aes("drv", "hwy")) + stat_summary(aes(lower='..lq..', middle='..mq..', upper='..uq..'), geom='boxplot')