r语言绘图
plot
type
"p" for points, "l" for lines, 点图
"b" for both points and lines, 折线图
"c" for empty points joined by lines, 点线图(去点)
"o" for overplotted points and lines, 点线图
"s" and "S" for stair steps and
"h" for histogram-like vertical lines. Finally, 线图
"n" does not produce any points or lines.不显示任何
pie 饼状图
pie(百分比,标注文字,main=“标题文字”,颜色)
x <- c(1,2,3,4,5)
> a <- c("a","b","c","d","e")
> pct2 <- round(x/sum(x)*100)
> b <- paste(a,pct2,"%")
> pie(x,labels = b,radius = 0.5,col=rainbow(length(b)))
fan.plot 扇形图
x <- c(1,2,3,4,5)
> a <- c("a","b","c","d","e")
> pct2 <- round(x/sum(x)*100)
> b <- paste(a,pct2,"%")
> pie(x,labels = b,radius = 0.5,col=rainbow(length(b)))
hist 直方图
hist(mtcars$mpg,breaks = 15,freq = FALSE)
rug 轴须图
rug(jitter(mtcars$mpg))
用来表示密集程度的
lines(density(mtcars$mpg))
线段拟合,用来更缓和的说明问题

浙公网安备 33010602011771号