R ggplot2
来源:互联网 发布:淘宝xboxone手柄 编辑:程序博客网 时间:2024/05/17 08:16
ggplot2 "grammar of graphics"绘图的语法
数据源:data frame
----------------------------------
ggplot 绘图语法的组成部分
A data frame
aesthetic mappings:如何将数据与颜色、大小和点对应
geoms; 页面上的特定对象点线形
facets: 多面板条件绘图
stats: 统计变换
scales: 不同变量如何编码
coordinate: 坐标系
summary:观察ggplot
----------------------------------
g<-ggplot(data,aes(x=,y=))
color ##颜色(使用factor值)
alpha ##透明度
+geom_point() ##绘图
color
size
alpha
aes()
color #分组分色显示
+geom_smooth(method="lm") ##加入回归曲线(默认平滑曲线)
size
linetype ##线条格式
method
se ##是否显示置信区间
col
+facet_grid(.~x) ##格网分面绘图(在绘图前订立因子)
(y~x)
margions ##是否显示total情况
+facet_wrap(y~x) ##缠绕分面,按从左到右从上到下的“缠绕”顺序进行排列
nrow
ncol
+theme() ##全局变量
+labs() ##label
x
y
title
+theme_gray() ##默认的灰背景
+theme_bw() ##黑白背景
base_family ##字体
base_size
+ylim(-3,3) ##筛选y值在-3-3范围内的数据
+coord_cartesian(ylim=c(-3,3)) ##显示-3到3部分的图像(保证数据完整性)
+ggtitle() ##标题
等分连续变量为因子变量
---cutpoints<-quantile(maacs$logno2,seq(0,1,length=4),na.rm=true)
---maacs$no2dec<-cut(macs$logno2,cutpounts)
- R ggplot2
- R ggplot2 做图
- R -ggplot2 气泡图
- R-ggplot2绘图学习
- R、ggplot2、shiny 汇总
- R语言ggplot2画图
- R ggplot2画柱状图
- R ggplot2之qplot
- R语言ggplot2饼状图
- R语言GGPlot2
- R ggplot2条形图
- R ggplot2线性图
- R ggplot2画饼状图
- R可视化绘图二-ggplot2
- R ggplot2画线形图
- R画图之ggplot2-->柱状图
- [置顶]R语言 ggplot2包
- R语言 绘图 (ggplot2)
- hrbust1224
- hdu3527spy(STL,map)
- 单链表的反转/逆序的三种方法
- LeetCode---------copy-list-with-random-pointer
- LIS++
- R ggplot2
- HDU 3532 Max Angle(计算几何——极角排序)
- Spring实战基础1
- HDU 5920 Ugly Problem 【模拟】 (2016中国大学生程序设计竞赛(长春))
- 你想建设一个能承受500万PV/每天的网站吗?
- javax.crypto.IllegalBlockSizeException: Input length must be multiple of 16 when decrypting with pad
- HTML中表单提交数据GET、POST的区别
- 1056. Mice and Rice (25)
- R color颜色