3 Data visualisation (II)

3.6 Geometric objects

ggplot(data = mpg) + geom_point(mapping = aes(x = displ, y = hwy))
ggplot(data = mpg) + geom_smooth(mapping = aes(x = displ, y = hwy))

点图
3.8.png

平滑的趋势图
3.9.png
ggplot(data = mpg) + geom_smooth(mapping = aes(x = displ, y = hwy, linetype = drv))

以drv分类,可以看出每种类别的趋势
3.10.png

将不同的图绘制在一个图上面

你可能感兴趣的:(3 Data visualisation (II))