Search code examples
rpackagestatisticsmodelingcran

how can i setting a 2x3 graphical space to make plots?


How can I define a graphics space to make plots like the attached figure below using the graphics package in r?

Like this figure


Solution

  • You can do:

    par(mfrow = c(2, 3))
    par(mar = c(0, 0, 0, 0))
    

    Then create six plots, of which two are empty:

    # empty plot
    plot.new()
    
    # first plot (top center)
    plot(1:10, 1:10)
    
    # empty plot
    plot.new()
    
    # second plot (bottom left)
    plot(1:10, 1:10)
    
    # third plot (bottom center)
    plot(1:10, 1:10)
    
    # fourth plot (bottom right)
    plot(1:10, 1:10)
    

    enter image description here