语言plot图上带上数值_R语言 第五章 高级绘图工具(2)

通过panel参数给散点图添加回归线、光滑曲线、轴须、网格线等h=-1 and v=-1are intended to make the grids aligned with the axis labels. 使网格与轴标签对齐mypanel function(x,y){panel.xyplot(x,y,pch = 19)#添加散点图panel.rug(x,y) #添加坐标轴须panel...
摘要由CSDN通过智能技术生成

通过panel参数给散点图添加回归线、光滑曲线、轴须、网格线等

h=-1 and v=-1are intended to make the grids aligned with the axis labels. 使网格与轴标签对齐

mypanel function(x,y){
    panel.xyplot(x,y,pch = 19)#添加散点图panel.rug(x,y) #添加坐标轴须panel.grid(h =-1,v =-1) #添加水平和竖直网格线,使用负数强制与轴标签对齐panel.lmline(x,y,col = “red”, lwd = 1,lty = 2)} #添加一条回归线
xyplot(mpg ~wt|disp, data = mtcars,layout = c(3,1),aspect = 1.5,panel = mypanel,main = “Miles per Gallon vs Weight by Engin Displacesment”,xlab = “Weight”,ylab = “Miles per Gallon”)

Aspect:

    此参数控制面板的物理纵横比,通常所有面板的物理纵横比都相同。它可以指定为比率(垂直大小/水平大小)或字符串。

    Aspect此参数的控制面板的物理纵横对比,通常所有面板的物理纵横比都相同,它可以指定为比率(垂直大小/水平大小)或者字符串

    通过添加条件变量,可以创建出各个水平下的面板。若想要把不同水平的图形结

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值