Skip to contents

This function closes all existing graphical devices and opens a new one with specified width and height dimensions.

Usage

set_graphics(width, height)

Arguments

width

Numeric value specifying the width of the new plotting device in centimeters.

height

Numeric value specifying the height of the new plotting device in centimeters.

Details

The set_graphics function first closes all open graphical devices using graphics.off(). It then opens a new graphical device with the given dimensions using dev.new(). The unit parameter is set to "cm" to use centimeters for the dimensions, and noRStudioGD is set to TRUE to avoid using RStudio's graphical device.

Examples

if (FALSE) { # \dontrun{
# Set up a new plotting device with width 10 cm and height 7 cm
set_graphics(10, 7)
} # }