zoukankan      html  css  js  c++  java
  • par函数mgp 参数-控制坐标轴的位置

    mgp 参数的值为长度为3的一个向量,默认值为 c(3, 1, 0); 3个数值控制的元素不同

    1) 第一个数值:3, 控制xlab 和  ylab的位置

    示例用法:

    par(mfrow = c(1, 3), oma = c(1, 1, 1, 1))

    plot(1:10, main = "main", sub = "sub", mgp = c(1, 1, 0))
    box(which = "figure")
    plot(1:10,main = "main", sub = "sub", mgp = c(2, 1, 0))
    box(which = "figure")
    plot(1:10, main = "main", sub = "sub",mgp = c(3, 1, 0))
    box(which = "figure")

    效果图如下:

    注意观察,xlab 和 ylab的位置,从左到右我分别设置了1到3; 从图中也可以看出来,影响的元素的包括xlab, ylab, sub

    2) 第二个数值 1, 影响的是坐标轴的轴线的位置

     示例用法:

    par(mfrow = c(1, 3), oma = c(1, 1, 1, 1))
    
    plot(1:10, main = "main", sub = "sub", mgp = c(3,1, 0))
    box(which = "figure")
    plot(1:10,main = "main", sub = "sub", mgp = c(3, 2, 0))
    box(which = "figure")
    plot(1:10, main = "main", sub = "sub",mgp = c(3, 3, 0))
    box(which = "figure")

    效果图如下:

    可以看出,受影响的元素为 坐标轴对应的标签的位置;

    3) 第三个数值 0:

    示例用法:

    par(mfrow = c(1, 3), oma = c(1, 1, 1, 1))
    
    plot(1:10, main = "main", sub = "sub", mgp = c(3,1, 0))
    box(which = "figure")
    plot(1:10,main = "main", sub = "sub", mgp = c(3, 1, 1))
    box(which = "figure")
    plot(1:10, main = "main", sub = "sub",mgp = c(3, 1, 2))
    box(which = "figure")

    效果图如下:

    可以看到,影响的元素为坐标轴轴线的位置;

  • 相关阅读:
    oralce 10g(10.2.0.1) 冷备份从64位恢复到32位
    Java反序列化漏洞总结
    正则表达式优化总结
    机器学习笔记(持续更新)
    Java反序列化漏洞分析
    ThinkPHP5 远程命令执行漏洞分析
    Joomla对象注入漏洞分析
    crontab一句话后门分析
    WeCenter3.1.7 blind xxe 分析
    Redis Getshell总结
  • 原文地址:https://www.cnblogs.com/xudongliang/p/7993109.html
Copyright © 2011-2022 走看看