inst/examples/diamonds-carat.R

# 按雕琢水平切片后的钻石重量密度曲线
data("diamonds")
library(ggplot2)
levels(diamonds$cut) = c("一般", "良好", "优质", "珍贵", "完美")
p = ggplot(aes(x = carat), data = diamonds) +
  geom_density() +
  labs(x = "重量", y = "分布密度") +
  facet_grid(cut ~ .)
print(p)

Try the MSG package in your browser

Any scripts or data that you put into this service are public.

MSG documentation built on July 22, 2021, 1:06 a.m.