R中的空图 [英] Empty plot in R

查看:72
本文介绍了R中的空图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我重新安装了ARCH linux,并重新安装了R版本2.15.1.但是在使用plot命令绘制任何内容之后,绘图窗口始终为空(未显示任何内容).驱动程序或其他东西可能有问题.我尝试了graphics.off()函数,但无济于事.

问题已修改:

但是,在调整绘图窗口大小之后,该绘图是可见的.

  x< -c(1、2、3、4、5)y <-c(0.1、0.3、0.7、1.11、1.3)情节(x,y)>sessionInfo()R版本2.15.1(2012-06-22)平台:x86_64-unknown-linux-gnu(64位)语言环境:[1] C附带的基本软件包:[1]统计图形grDevices utils数据集方法库 

问题已修改:

设置X11.options(type ="nbcairo")正常.

解决方案

有时您需要执行初始的 plot.new() dev.new()初始化图形设备.这应该与plot.default()一起发生,这是当您给 plot 两个向量时会调用的函数.

有些选项可能会影响图形设备的调用.使用 names(options())查看选项列表名称的向量.我的系统已经设置好,所以options()$ device正确设置了石英设备的默认设置.这是在加载grDevices软件包时定义的选项.参见:

grDevices部分中的

 ?options#. 

使用ARCH-Linux意味着您正走在一条人迹罕至的道路"上.Debian(以及Debian派生的变体,如Ubuntu)和RH Linuxen安装的经验丰富.我确实从使用ARCH Linux的人员那里发现了两篇关于r-devel的文章,所以这并不意味着知识广泛.既然您的行为显示出具有交互式图形驱动程序的功能,但是最初的绘制"功能只是一个小问题,那么您最好将其发布到r-devel邮件列表中.

I did a fresh install of ARCH linux and so of R version 2.15.1. But after plotting anything with the plot command, the plot window is always empty (nothing shown). Could there be an issue with drivers or something else. I have tried graphics.off() function but to no avail.

Question edited:

The plot however is visible after resizing the plot window.

x<-c(1, 2, 3, 4, 5)
y<-c(0.1, 0.3, 0.7, 1.11, 1.3) 
plot(x, y) 

> sessionInfo() 
R version 2.15.1 (2012-06-22) 
Platform: x86_64-unknown-linux-gnu (64-bit) 
locale: 
[1] C 

attached base packages: 
[1] stats graphics grDevices utils datasets methods base

Question edited:

Setting X11.options(type="nbcairo") works fine.

解决方案

Sometimes you need to execute an initial plot.new() or dev.new() to initialize the graphics device. That is supposed to be happening with plot.default() which is the function that would have been called when you gave plot two vectors.

There are options that can affect the graphics device call. Use names(options()) to see the vector of names of the options list. My system is set up so options()$device sets up the quartz device defaults properly. This is an option that is defined when the grDevices package is loaded. See:

?options   # in the grDevices section.

Using ARCH-Linux means you are going down a "less traveled path". There are many more experienced users of Debian (and Debian derived variants like Ubuntu) and RH Linuxen installations. I did find two postings to r-devel from persons using ARCH Linux, so that doesn't suggest widespread knowledge. You might be better off posting to the r-devel mailing list, now that you have behavior that shows there is interactive graphics driver capability, but just a glitch in the initial 'draw' functionality.

这篇关于R中的空图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆