服务热线
178 0020 3020
Plot 1:
library(ggplot2)
>data<- read.csv(file.choose())
>ggplot(data,aes(x=bwt,fill=factor(data$smoke)))+geom_histogram(binwidth=500,colour="black",position="dodge")+ggtitle("R2-39")+xlab("birth weight")+ylab("count")+scale_fill_discrete(h=c(0,200),c=400,name="Smoke",labels = c("no","yes"))
Plot2:
>library(ggplot2)
>ggplot(diamonds,aes(x=carat,color = color))+geom_density(size =0.5)+xlab("carat")+ylab("density")+ggtitle("R2-39")
附件