zoukankan      html  css  js  c++  java
  • R语言中layout图形布局函数

    1、

    attach(mtcars)
    layout(matrix(c(1,1,2,3), 2, 2, byrow=T))
    hist(wt)
    hist(mpg)       
    hist(disp)
    detach(mtcars)

    2、

    attach(mtcars)
    layout(matrix(c(1,2,3,3),2,2,byrow = T))
    hist(wt)
    hist(mpg)
    hist(disp)
    detach(mtcars)

    3、

    layout(matrix(c(1,1,2,3),2,2,byrow = F))
    plot(1:10)
    plot(1:10)
    plot(1:10)

    4、

    layout(matrix(c(1,2,3,3), nrow = 2, ncol = 2,byrow = F))
    plot(1:10)
    plot(1:10)
    plot(1:10)

    5、

    layout(matrix(c(1,2,3,3,3,3), nrow = 3, ncol = 2, byrow = T))
    plot(1:10)
    plot(1:10)
    plot(1:10)

    6、

    layout(matrix(c(1,2,3,4,4,4),3,2,byrow = F))
    plot(1:10)
    plot(1:10)
    plot(1:10)
    plot(1:10)

    7、

    layout(matrix(c(1,2,2,3,3,3),3,2,byrow = F))
    plot(1:10)
    plot(1:10)
    plot(1:10)

    8、

    layout(matrix(c(1,2,3,2,3,4),3,2,byrow = T))
    plot(1:10)
    plot(1:10)
    plot(1:10)
    plot(1:10)

    9、

    attach(mtcars)
    layout(matrix(c(1,1,2,3),2,2,byrow = T), widths = c(3,1),heights = c(1,2))
    hist(wt)
    hist(mpg)
    hist(disp)
    detach(mtcars)

    10、

    layout(matrix(c(1,1,2,3),2,2,byrow = F),widths = c(1:3),heights = c(3:1))
    plot(1:10)
    plot(1:10)
    plot(1:10)

    11、

    layout(matrix(c(1,1,2,3,2,4),3,2,byrow = T), heights = c(1:2,2),
           widths = c(1:2) )
    plot(1:10)
    plot(1:10)
    plot(1:10)
    plot(1:10)

  • 相关阅读:
    linux配置PHP环境!!(云服务器架设)
    JQ上传预览+存数据库
    AJAX做增删改查详细!
    JS解析XML
    UEditor编辑器的使用
    php注释规范
    phpexcel导出数据表格
    简单分析JavaScript中的面向对象
    制作smarty模版缓存文件
    求二叉树中节点的最大距离
  • 原文地址:https://www.cnblogs.com/liujiaxin2018/p/14668259.html
Copyright © 2011-2022 走看看