R 画图遇到的问题

> ggplot(aes(x = age, y = friend_count), data = pf) +
  coord_cartesian(xlim = c(13, 90)) +
  geom_point(alpha = 1/20,
             position = position_jitter(h = 0),
             color = 'orange') + 
  coord_trans(y = "sqrt") +
  geom_line(stat = "summary", fun.y = mean) +
  geom_line(stat = "summary", fun.y = quantile, fun.args = list(probs = .1), linetype = 2, color = "blue")

Coordinate system already present. Adding new coordinate system, which will replace the existing one.

R 画图遇到的问题_第1张图片

coord_cartesian(xlim = c(13, 90)) 改为 xlim(13, 90) 即可。

你可能感兴趣的:(学习笔记)