设置RGL设备的大小 [英] Setting size of the rgl device

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

问题描述

我的rgl设备的全屏/非全屏问题.

I have a problem with the fullscreen / non-fullscreen of my rgl device.

当前我使用R 3.00

Currently I use R 3.00

我在设备中绘制了一个persp3d图(库rgl),它在一个很小的窗口中打开:

I plot a persp3d plot (library rgl) into my device, it opens in a quite small window:

R代码:

persp3d(x, y, z, theta=50, phi=25, expand=0.75, col=red,
        ticktype="detailed", xlab="", ylab="", zlab="",axes=FALSE)
axes3d(c('x--','z'))

axis3d(edge='y+-',at =c(1,500,1000,1500,2000,2320),
labels =rownames(fd)[c(1,500,1000,1500,2000,2320)])

看起来像这样:

我现在旋转它并将单个png文件保存到驱动器中.问题是png文件太小?我想使用LaTex和\animategraphics命令将它们放到一张纸中,但这要像素化(不清晰).

I now rotated it and saved the single png files to my drive. The problem is, that the png files are too small? I want to put them into one paper using LaTex and the \animategraphics command, but it is to pixely (not sharp).

如果我单击rgl设备中的全屏图标,以使R图更大,这确实有帮助,并且一切正常.问题是,它周围有太多空白.在上面,下面,左边和右边都有这个空白,我不能将其包含在LaTex中,因为它的大小(宽度,高度)不合适,因此无法容纳.我有200个png文件,所以用油漆手动去除空白不是一件好事.

If I click on the fullscreen icon in the rgl device, so that the R plot is larger, this does help and everything works. The problem is, that there is too much white space around it. With this white space above, below, left and right to it I cannot include it in LaTex, because it does not fit because of its big size (width, height). I have 200 png files, so manually removing the white space with paint is not a nice work.

小图片如下:

如果放大,则会发生以下情况(这就是LaTex的功能,当我将其放入纸中时,它会增加图片,屏幕截图来自我的LaTex文件.同一张图片,角度略有不同,但是问题是保持不变):

The following happens, if you zoom in (this is, what LaTex does, when I put it into my paper, it increases the picture, screenshot is from my LaTex file. Same picture, a slightly different angle, but the problem stays the same):

您看到它看起来像像素(不好).另外,您已经可以看到空白空间太大的大文件的问题:上面有空白空间的小图片已经破坏了我的标题.

You see that it looks pixely (not good). Also you can already see the problem with the large files with too much white space: The small picture with some white space above already destroys my title.

那么我该如何解决这个问题?如何告诉R使用全屏显示,但周围没有太多空白?当我单击全屏并保存这些图片时,一切都很好,除了周围的空白.

So how could I solve this problem? How can I tell R to use the fullscreen plots but without so much white space around it? When I click on fullscreen and save those pictures everything is fine, except the white space around it.

这是png文件,周围有太多空白(在此屏幕截图中,下面没有空白,但是当我使用正确的缩放比例时,它就在其中):

Here is the png file with too much white space around it (in this screenshot there is no white space below, but when I use the correct zoom it is there):

另外一点:这是我用来保存png-文件的R代码:

One further note: This is the R code I use to save the png- files:

M <- par3d("userMatrix")
movie3d( spin3d(rpm=3), duration=20,dir="C:/test/movie", clean=FALSE )
play3d( spin3d(rpm=3), duration=20)

推荐答案

使用par3d(windowRect = c(20,30,800,800))

Use par3d(windowRect = c(20, 30, 800, 800))

这篇关于设置RGL设备的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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