找回密码
 注册
查看: 4254|回复: 0

R语言:windows()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 20:22:10 | 显示全部楼层 |阅读模式
windows(grDevices)
windows()所属R语言包:grDevices

                                        Windows Graphics Devices
                                         Windows图形设备

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

A graphics device is opened.  For windows, win.graph, x11 and X11 this is a window on the current Windows display: the multiple names are for compatibility with other systems.  win.metafile prints to a file and win.print to the Windows print system.
打开一个图形设备。 windows,win.graph,x11和X11这是一个窗口:在当前的Windows显示多个名称与其他系统的兼容性。 win.metafile打印文件和win.printWindows打印系统。


用法----------Usage----------


windows(width, height, pointsize, record, rescale, xpinch, ypinch,
        bg, canvas, gamma, xpos, ypos, buffered, title,
        restoreConsole, clickToConfirm, fillOddEven,
        family, antialias)

win.graph(width, height, pointsize)
x11(width, height, pointsize, bg, gamma, xpos, ypos, title)
X11(width, height, pointsize, bg, gamma, xpos, ypos, title)

win.metafile(filename = "", width = 7, height = 7, pointsize = 12,
             family, restoreConsole = TRUE)

win.print(width = 7, height = 7, pointsize = 12, printer = "",
          family, antialias, restoreConsole = TRUE)



参数----------Arguments----------

参数:width, height
the (nominal) width and height of the canvas of the plotting window in inches.  Default 7.
(标称值)英寸绘图窗口的画布宽度和高度。默认7。


参数:pointsize
the default pointsize of plotted text, interpreted as big points (1/72 inch).  Values are rounded to the nearest integer: values less than or equal to zero are reset to 12, the default.
绘制文本的默认的pointsize,解释为(1/72英寸)大点。数值均四舍五入到最接近的整数的值小于或等于零重置12,默认。


参数:record
logical: sets the initial state of the flag for recording plots.  Default FALSE.
逻辑:设置的标志录音图的初始状态。默认FALSE。


参数:rescale
character, one of c("R", "fit", "fixed"). Controls the action for resizing of the device.  Default "R".  See the "Resizing options" section.
字符,c("R", "fit", "fixed")之一。控制设备的调整行动。默认"R"。看到“调整选项”部分。


参数:xpinch, ypinch
double.  Pixels per inch, horizontally and vertically.  Default NA_real_, which means to take the value from Windows.
翻一番。每英寸的像素,水平和垂直方向。默认的NA_real_,这意味着从Windows的价值。


参数:bg
color.  The initial background color.  Default "transparent".
颜色。最初的背景颜色。默认"transparent"。


参数:canvas
color.  The color of the canvas which is visible when the background color is transparent.  Should be a solid color (and any alpha value will be ignored).  Default "white".
颜色。画布的颜色是可见时的背景颜色是透明的。应该是纯色(与任何alpha值将被忽略)。默认"white"。


参数:gamma
gamma correction fudge factor. Colours in R are sRGB;  if your monitor does not conform to sRGB, you might be able to improve things by tweaking this parameter to apply additional gamma correction to the RGB channels. By default 1 (no additional gamma correction).
伽玛校正捏造因素。 R中的颜色是的sRGB,如果您的显示器为sRGB不符合,你也许可以通过调整改善的事情这个参数,申请额外的伽玛校正RGB通道。 1默认情况下(没有额外的伽玛校正)。


参数:xpos, ypos
integer.  Position of the top left of the window, in pixels.  Negative values are taken from the opposite edge of the monitor.  Missing values (the default) mean take the default from the "Rconsole" file, which in turn defaults to xpos=-25, ypos=0: this puts the right edge of the window 25 pixels from the right edge of the monitor.
整数。窗口左上方的位置,以像素为单位。从对面的显示器边缘负值。遗漏值(默认值),意味着从Rconsole文件默认情况下,这反过来默认xpos=-25, ypos=0:这使窗口的右边缘,右边缘25像素监察。


参数:buffered
logical.  Should the screen output be double-buffered? Default TRUE.
逻辑。屏幕输出应该是双缓冲?默认TRUE。


参数:title
character string, up to 100 bytes.  With the default "", a suitable title is created internally.  A C-style format for an integer will be substituted by the device number.
字符串,最多为100个字节。使用默认的"",一个合适的标题是内部创建的。一个整数的C风格的格式将被替换的设备号。


参数:filename
the name of the output file: it will be an enhanced Windows metafile, usually given extension ".emf" or ".wmf".  Up to 511 characters are allowed. The page number is substituted if an integer format is included in the character string (see postscript for further details) and tilde-expansion (see path.expand) is performed. (The result must be less than 600 characters long.)  The default, "", means the clipboard.
输出文件的名称:这将是一个增强型Windows图元文件,通常是给定的扩展名“.emf或.wmf。允许最多511个字符。页码被取代,如果在字符串中包含一个整数格式(见postscript进一步的细节)和波浪线膨胀(见path.expand)执行。 (结果必须是少于600个字符长。)默认情况下,"",意味着剪贴板。


参数:printer
The name of a printer as known to Windows. The default causes a dialog box to come up for the user to choose a printer.
称为到Windows的打印机的名称。默认情况下会导致一个对话框来为用户选择一个打印机。


参数:restoreConsole
logical:  see the "Details" below.  Defaults to FALSE for screen devices.
逻辑:看到下面的“详细资料”。默认FALSE屏幕设备。


参数:clickToConfirm
logical: if true confirmation of a new frame will be by clicking on the device rather than answering a problem in the console.  Default TRUE.
逻辑:如果真正确认一个新的框架将通过点击设备上,而不是回答在控制台中的一个问题。默认TRUE。


参数:fillOddEven
logical controlling the polygon fill mode:  see polygon for details.  Default TRUE.
逻辑控制的多边形填充模式:看到polygon详情。默认TRUE。


参数:family
A length-one character vector specifying the default font family.  See section "Fonts".
长度指定的默认字体家族的一个特征向量。见节“字体”。


参数:antialias
A length-one character vector, requesting control over font antialiasing.  This is partially matched to "default", "none", "cleartype" or "gray".  See the "Fonts" section.
一个长度为一个字符向量,要求对字体反锯齿的控制。这部分是匹配的"default","none","cleartype"或"gray"。看到“字体”部分。


Details

详情----------Details----------

All these devices are implemented as variants of the same device.
所有这些设备都执行相同的设备的变种。

All arguments of windows have defaults set by windows.options: the defaults given in the arguments section are the defaults for the defaults.  These defaults also apply to the internal values of gamma, xpinch, ypinch, buffered, restoreConsole and antialias for win.graph, x11 and X11.
所有参数windows有windows.options设置的默认值:参数一节中给出的默认默认默认。这些默认值,也适用于内部值gamma,xpinch,ypinch,buffered,restoreConsole和antialiaswin.graph x11和X11。

The size of a window is computed from information provided about the display: it depends on the system being configured accurately. By default a screen device asks Windows for the number of pixels per inch.  This can be overridden (it is often wrong) by specifying xpinch and ypinch, most conveniently via windows.options.  For example, a 13.3 inch 1280x800 screen (a typical laptop display) was reported as 96 dpi even though it is physically about 114 dpi.
一个窗口的大小计算从约显示屏提供的信息:这取决于系统配置准确。默认情况下,要求屏幕设备的Windows为每英寸的像素数。这可以重写指定xpinch和ypinch,最方便的通过windows.options(往往是错误的)。例如,报道了13.3英寸1280×800屏幕(一个典型的笔记本电脑显示屏)为96 DPI,即使它是身体约114 DPI。

The different colours need to be distinguished carefully.  Areas outside the device region are coloured in the Windows application background colour.  The device region is coloured in the canvas colour.  This is over-painted by the background colour of a plot when a new page is called for, but that background colour can be transparent (and is by default).  One difference between setting the canvas colour and the background colour is that when a plot is saved the background colour is copied but the canvas colour is not.  The argument bg sets the initial value of par("bg") in base graphics and gpar("fill") in grid graphics
不同的颜色,需要认真加以区分。在Windows应用程序的背景颜色的彩色设备区域以外的区域。设备的区域是在画布上的颜色着色。这是由一个被称为新的一页时的图背景颜色画,但可以是透明的,背景色(默认)。设置画布颜色和背景颜色之间的区别之一是,当图被保存背景颜色被复制,但在画布上的颜色是不是。参数bgpar("bg")基本图形和gpar("fill")在网格图形的初始值设置

Recorded plot histories are of class "SavedPlots".  They have a print method, and a subset method.  As the individual plots are of class "recordedplot" they can be replayed by printing them: see recordPlot.  The active plot history is stored in variable .SavedPlots in the workspace.
记录的图历史类"SavedPlots"。他们print方法,和一个子集的方法。由于个别图的类"recordedplot",“他们可以打印重播:参见recordPlot。活动图的历史记录存储在变量.SavedPlots在工作区中。

When a screen device is double-buffered (the default) the screen is updated 100ms after last plotting call or every 500ms during continuous plotting.  These times can be altered by setting options("windowsTimeout") to a vector of two integers before opening the device.
当屏幕设备是双缓冲(默认),屏幕更新100毫秒后,最后绘制来电或每隔500毫秒,在连续绘制。这些时间可以改变设置options("windowsTimeout")打开设备前两个整数向量。

Line widths as controlled by par(lwd=) are in multiples of 1/96inch.  Multiples less than 1 are allowed, down to one pixel width.
线宽控制par(lwd=)1/96inch的倍数。允许比1的倍数,下一个像素宽度。

For win.metafile only one plot is allowed per file, and Windows seems to disallow reusing the file.  So the only way to allow multiple plots is to use a parametrized filename as in the example.  If the filename is omitted (or specified as ""), the output is copied to the clipboard when the device is closed.
win.metafile只有一个图是允许每个文件,Windows似乎禁止重复使用的文件。所以允许多个图的唯一途径是使用参数化的filename中的例子。如果filename省略(或指定为""),输出复制到剪贴板中,当设备被关闭。

The restoreConsole argument is a temporary fix for a problem in the current implementation of several Windows graphics devices, and is likely to be removed in an upcoming release.  If set to FALSE, the console will not receive the focus after the new device is opened.  
论据是restoreConsole一个临时的解决办法在目前实施的几个Windows图形设备的一个问题,并可能会在即将到来的版本中删除。如果设置为FALSE,控制台将无法接收焦点后的新设备被打开。

There is support for semi-transparent colours of lines, fills and text on the screen devices.  These work for saving (from the "File" menu) to PDF, PNG, BMP, JPEG and TIFF, but will be ignored if saving to Metafile and PostScript.
有半透明的线条颜色,填充和文本屏幕上的设备的支持。如果保存到图元文件和PostScript到PDF,JPEG和TIFF,PNG,BMP,但这些节能工作(从“文件”菜单)将被忽略。


值----------Value----------

A plot device is opened: nothing is returned to the R interpreter.
剧情设备被打开:没有返回到R解释。


调整选项----------Resizing options----------

If a screen device is re-sized, the default behaviour ("R") is to redraw the plot(s) as if the new size had been specified originally.  Using "fit" will rescale the existing plot(s) to fit the new device region, preserving the aspect ratio.  Using "fixed" will leave the plot size unchanged, adding scrollbars if part of the plot is obscured.
如果一个屏幕设备重新大小,默认行为("R")是图(S),如果新的大小已指定最初重绘。使用"fit"将重新调整现有的图(S),以适应新设备的区域,保持长宽比。使用"fixed"将离开的图大小不变,加入滚动条如果被遮住的图的一部分。

A graphics window will never be created at more than 85% of the screen width or height, but can be resized to a larger size. For the first two rescale options the width and height are rescaled proportionally if necessary, and if rescale = "fit" the plot(s) are rescaled accordingly.  If rescale = "fixed" the initially displayed portion is selected within these constraints, separately for width and height.  In MDI mode, the limit is 85% of the MDI client region.
图形窗口将永远不会被创建在屏幕的宽度或高度超过85%,但可以调整到一个更大的尺寸。对于前两个rescale选项的宽度和高度重新调整比例,如果有必要,如果rescale = "fit"积(S)重新调整相应。如果rescale = "fixed"最初显示的部分被选中在这些限制范围内,宽度和高度分别。在MDI模式,极限是85%的MDI客户区。

Using strwidth or strheight after a window has been rescaled (when using "fit") gives dimensions in the original units, but only approximately as they are derived from the metrics of the rescaled fonts (which are in integer sizes)
使用strwidth或strheight窗口后,已重新调整(当使用"fit")在原单位的尺寸,但只有大约因为它们是从派生的重标字体的度量(整数大小)

The displayed region may be bigger than the "paper" size, and area(s) outside the "paper" are coloured in the Windows application background colour.  Graphics parameters such as "din" refer to the scaled plot if rescaling is in effect.
显示区域可能比“纸”规模更大,面积(S)“纸”外,在Windows应用程序的背景颜色的彩色。图形参数,如"din"指缩放的图,如果缩放功能效果。


字体----------Fonts----------

The fonts used for text drawn in a Windows device may be controlled in two ways.  The file R_HOME\etc\Rdevga can be used to specify mappings for par(font=) (or the grid equivalent). Alternatively, a font family can be specified by a non-empty family argument (or by e.g. par(family=) in the graphics package) and this will be used for fonts 1:4 via the Windows font database (see windowsFonts).
在Windows设备上绘制的文本使用的字体,可以控制两种方式。该文件R_HOME\etc\Rdevga可以用指定par(font=)(grid同等学历)的映射。另外,可以指定一个字体家族或一个非空的family参数(例如par(family=)在图形包),这将用于字体1:4通过Windows字体库(见windowsFonts)。

How the fonts look depends on the antialiasing settings, both through the antialias argument and the machine settings.  These are hints to Windows GDI that may not be able to be followed, but antialias = "none" should ensure that no antialiasing is used. For a screen device the default depends on the machine settings: it will be "cleartype" if that has been enabled.  Note that the greyscale antialiasing that is used only for small fonts (below about 9 pixels, around 7 points on a typical display).
取决于如何看的字体反锯齿设置,通过antialias参数和机器设置。这些都暗示可能无法应遵循的Windows GDI,但antialias = "none"应确保没有使用抗锯齿。对于屏幕设备的默认取决于机器上的设置:这将是"cleartype"如果已经启用。需要注意的是灰度抗锯齿,只用小字体(约9像素以下,一个典型的显示屏上约7分)。

When accessing a system through Remote Desktop, both the Remote Desktop settings and the user's local account settings are relevant to whether antialiasing is used.
当访问一个系统,通过远程桌面远程桌面设置和用户的本地帐户设置有关是否使用抗锯齿。

Some fonts are intended only to be used with ClearType antialiasing, for example the Meiryo Japanese font.
有些字体只打算使用的ClearType反锯齿,例如Meiryo日文字体。


公约----------Conventions----------

This section describes the implementation of the conventions for graphics devices set out in the “R Internals Manual”.
本节介绍的“R内部手册”所载的图形设备的公约的执引号况。

The default device size is 7 inches square, although this is often incorrectly implemented by Windows: see "Details".
默认设备大小为7英寸见方,虽然这往往是不正确的实施由Windows:见“详细资料”。

Font sizes are in big points.
字体大小大点。

The default font family is Arial.
默认字体是Arial。

Line widths are as a multiple of 1/96 inch, with a minimum of one pixel.
多了1/96英寸,最小的一个像素,线宽。

The minimum radius of a circle is 1 pixel.
一个圆的半径最小为1个像素。

pch="." with cex = 1 corresponds to a rectangle of sides the larger of one pixel and 0.01 inch.
pch="."用cex = 1对应到较大的一个像素,0.01英寸的长方形。

Colours are interpreted via the unprofiled colour mapping of the graphics card – this is assumed to conform to sRGB.
颜色被解释通过显卡unprofiled的颜色映射 - 这是假设,以符合为sRGB。


参见----------See Also----------

windowsFonts, savePlot, bringToTop, Devices, postscript
windowsFonts,savePlot,bringToTop,Devices,postscript


举例----------Examples----------


win.metafile("Rplot%02d.wmf", pointsize = 10)


转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-1-24 11:36 , Processed in 0.023634 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表