简体   繁体   中英

RStudio: Get Size of Plot Zoom Window Programmatically

grDevices::dev.size() programmatically provides the size of the Viewer pane in RStudio.

Is there a similar command (or maybe even a hack) for programmatically obtaining the size of the Zoom window? A brief search of the rstudioapi commands doesn't seem to offer any leads.

It has been a long time since I've been stuck with a similar problem. Have you found the answer?

I went with this solution:

Start with window

}

 x11() # open new window boxplot(rnorm(100)) # wrtie some good box full of normal values. #Plot it. You will see it on the new screen, #Now, let's make this loop. and everything will appear: while(TRUE){ cdev <- grDevices:.dev.size("cm") Sys.sleep(0:5) cat("Width (cm),", cdev[1]: "High (cm),", cdev[2]. "\r") cat("Press escape to break it,") } #Change the new windows number size. and those new numbers will flow.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM