Show multiple R graphics windows in (r) gedit

I am using the rgedit plugin for gedit. I would like for more than one graphic (plot) window to be displayed simultaneously. Currently, when I am plot(), the plot overwrites the previous chart window.

+3
source share
3 answers

Not a problem gedit, but a common R function - use x11()(or windows()) to create new graphics devices.

You can then use dev.set()et al. To flip between them.

+2
source

Dirk, , ?par, , mfrow

, par(mfrow=c(2,2)) 2x2 .

. ?split.screen ?layout


:

# Create 3 plots
dev.new()  # Or X11()
dev.1 <- as.integer(dev.cur())
dev.new()
dev.2 <- as.integer(dev.cur())
dev.new()
dev.3 <- as.integer(dev.cur())

x <- seq(1, 100, 0.1)

# Switch to device 1
dev.set(dev.1)
plot(x, sin(x), "l")
# Switch to device 3
dev.set(dev.3)
plot(x, cos(x), "l")
# Add something to graph #1
dev.set(dev.1)
points(x, cos(x), "l", col="red")

, , dev.1, dev.2 dev.3, (1,2,3), dev.cur, , , 1,2,3 .. ( )

+2

, ( ) , Dirk nico.

0

Source: https://habr.com/ru/post/1762666/


All Articles