基于RStudio实现数据可视化

基于RStudio实现数据可视化_第1张图片

> layout(matrix(c(1,2,3,3),nrow = 2, ncol = 2, byrow = TRUE), heights = c(2,1))
> par(mai=c(0.6,0.6,0.1,0.1),cex=0.7)
> x<-rnorm(1000)
> y<-rchisq(1000,10)
> hist(x,probability = TRUE, col = "lightblue",xlab = "x", ylab = "Density",ylim = c(0,0.4))
> plot(x,y,xlab = "x",ylab = "销售额",col = "green")
> boxplot(y,col = "red",lwd=1,horizontal = TRUE,varwidth = TRUE)

  

基于RStudio实现数据可视化_第2张图片

x<-seq(0.25,length=25)
y<-4+0.5*x+rnorm(25,0.2)
d<-data.frame(x,y)
plot(d)
polygon(d[chull(d),],col = "pink",lty = 3,lwd=2)
points(d)
abline(lm(y~x),lwd=2,col=4)
abline(v=mean(x),h=mean(y),lty=2,col="gray70")

  

转载请注明出处,谢谢!

 

转载于:https://www.cnblogs.com/RHadoop-Hive/p/10155686.html

你可能感兴趣的:(基于RStudio实现数据可视化)