用R语言 画条形图(基于ggplot2包)

时间:2015-03-02 16:47:38   收藏:0   阅读:1895

1.用qplot(x,data=data,geom.=”bar”,weight=y)+scale_y_continuous("y")画出y关于x的条形。

技术分享 

技术分享

 图中提示binwidth这里是指矩形的宽度,指定之后如下

qplot(x,data=data,geom="bar",weight=y,binwidth=0.2)+scale_y_continuous("y")

 技术分享

 

2.用qplot(x,data=data,geom.=”bar”)画出来的是频率直方图,反映的是单维变量

技术分享

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!