R学习与可视化

ggplot2数据分析与图形艺术-重点归纳(第3章后续)

2020-01-30  本文已影响0人  MJades

Statistical summaries

Revealing uncertainty
Weighted data 参数weight
# Unweighted
ggplot(midwest, aes(percwhite, percbelowpoverty)) + 
geom_point() + 
geom_smooth(method = lm, size = 1)

# Weighted by population
ggplot(midwest, aes(percwhite, percbelowpoverty)) + 
geom_point(aes(size = poptotal / 1e6)) + 
geom_smooth(aes(weight = poptotal), method = lm, size = 1) +
scale_size_area(guide = "none")
Displaying distributions
Dealing with overplotting

改变点的大小(像素点大小),调整透明度, 增加扰动点(geom_jitter), 转化为二维核密度估计问题,在图形基础之上增加数据摘要。
shape= 1 # 中空点;
shape= “.” # 像素大小


Fig 2
Fig 3
上一篇 下一篇

猜你喜欢

热点阅读