trellis.device(lattice)
trellis.device()所属R语言包:lattice
Initializing Trellis Displays
初始化网格显示
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Initialization of a display device with appropriate graphical parameters.
初始化一个适当的图形参数的显示设备。
用法----------Usage----------
trellis.device(device = getOption("device"),
color = !(dev.name == "postscript"),
theme = lattice.getOption("default.theme"),
new = TRUE,
retain = FALSE,
...)
standard.theme(name, color)
canonical.theme(name, color)
col.whitebg()
参数----------Arguments----------
参数:device
function (or the name of one as a character string) that starts a device. Admissible values depend on the platform and how R was compiled (see Devices), but usually "pdf", "postscript", "png", "jpeg" and at least one of "X11", "windows" and "quartz" will be available.
函数(或一个字符串的名字),启动设备。可容许值取决于平台和R的编译(见Devices),但通常是"pdf","postscript","png","jpeg"和至少一个"X11","windows"和"quartz"将可用。
参数:color
logical, whether the initial settings should be color or black and white. Defaults to FALSE for postscript devices, TRUE otherwise. Note that this only applies to the initial choice of colors, which can be overridden using theme or subsequent calls to trellis.par.set (and by arguments supplied directly in high level calls for some settings).
逻辑,初始设置是否应该是彩色或黑白。默认为FALSEPostScript设备,TRUE否则。请注意,这仅适用于初始颜色选择,它可以是theme(和直接提供一些设置的高层次调用的参数)使用trellis.par.set或后续调用覆盖。
参数:theme
list of components that changes the settings of the device opened, or, a function that when called produces such a list. The function name can be supplied as a quoted string. These settings are only used to modify the default settings (determined by other arguments), and need not contain all possible parameters. A possible use of this argument is to change the default settings by specifying lattice.options(default.theme = "col.whitebg"). For back-compatibility, this is initially (when lattice is loaded) set to options(lattice.theme). If theme is a function, it will not be supplied any arguments, however, it is guaranteed that a device will already be open when it is called, so one may use .Device inside the function to ascertain what device has been opened.
列表组件,改变设备的设置打开,或一个函数,调用时产生这样一个名单。可以提供带引号的字符串的函数的名称。这些设置仅用于修改默认设置(其他参数决定),而不必包含所有可能的参数。这一论点的一个可能的用途是由指定lattice.options(default.theme = "col.whitebg")改变默认设置。对于向后兼容性,这是最初(晶格加载时的)options(lattice.theme)。然而,如果theme是一个函数,它将不能提供任何参数,它是保证设备已被打开时,它被称为,所以可以使用.Device里面的功能,以确定哪些设备已经打开。
参数:new
logical flag indicating whether a new device should be started. If FALSE, the options for the current device are changed to the defaults determined by the other arguments.
逻辑标志,指示是否应开始一个新的设备。如果FALSE,当前设备的选项,改为由其他参数确定的默认。
参数:retain
logical. If TRUE and a setting for this device already exists, then that is used instead of the defaults for this device. By default, pre-existing settings are overwritten (and lost).
逻辑。如果TRUE该设备的设置已经存在,那么该设备的默认值是用来代替。默认情况下,现有的预设置是覆盖(和损失)。
参数:name
name of the device for which the setting is required, as returned by .Device
需要设置设备的名称,返回.Device
参数:...
additional parameters to be passed to the device function, most commonly file for non-screen devices, as well as height, width, etc. See the help file for individual devices for admissible arguments.
额外的参数传递给device功能,最常用的file非屏幕设备,以及height,width等个别帮助文件设备受理论据。
Details
详情----------Details----------
Trellis Graphics functions obtain the default values of various graphical parameters (colors, line types, fonts, etc.) from a customizable “settings” list. This functionality is analogous to par for standard R graphics and, together with lattice.options, mostly supplants it (par settings are mostly ignored by Lattice). Unlike par, Trellis settings can be controlled separately for each different device type (but not concurrently for different instances of the same device). standard.theme and col.whitebg produce predefined settings (a.k.a. themes), while trellis.device provides a high level interface to control which “theme” will be in effect when a new device is opened. trellis.device is called automatically when a "trellis" object is plotted, and the defaults can be used to provide sufficient control, so in a properly configured system it is rarely necessary for the user to call trellis.device explicitly.
格子图形功能获得一个可定制的“设置”列表中的各种图形参数(颜色,线条类型,字体等)的默认值。此功能类似于标准的R图形,并连同par,主要是取代lattice.options(par设置大多是由莱迪思忽略不计)。 与par,格子设置可以单独控制每个不同类型的设备(但不能同时在同一设备的不同实例)。 standard.theme和col.whitebg产生预定设置(即主题),而trellis.device提供一个高层次的接口来控制“为主题的”将是一个新的设备被打开时的效果。 trellis.device时自动调用"trellis"对象绘制,默认值,可以用来提供足够的控制,所以在一个正确配置的系统,它很少是必要的,为用户打电话trellis.device明确。
The standard.theme function is intended to provide device specific settings (e.g. light colors on a grey background for screen devices, dark colors or black and white for print devices) which were used as defaults prior to R 2.3.0. However, these defaults are not always appropriate, due to the variety of platforms and hardware settings on which R is used, as well as the fact that a plot created on a particular device may be subsequently used in many different ways. For this reason, a “safe” default is used for all devices from R 2.3.0 onwards. The old behaviour can be reinstated by setting standard.theme as the default theme argument, e.g. by putting options(lattice.theme = "standard.theme") in a startup script (see the entry for theme above for details).
standard.theme函数的目的是提供设备特定的设置(例如屏幕设备,深色或黑色和白色打印设备上的灰色背景光颜色)被作为默认的R 2.3.0之前使用。然而,这些默认值并不总是合适的,由于各种平台和硬件设置,其中R的使用,以及作为一个特定的设备上创建了一个图,随后可能会在许多不同的方式使用的事实。出于这个原因,“安全”默认用于所有设备从R 2.3.0开始。 standard.theme默认theme参数,如设置可以恢复旧的行为把options(lattice.theme = "standard.theme")在启动脚本(见theme上面的内容条目)。
值----------Value----------
standard.theme returns a list of components defining graphical parameter settings for Lattice displays. It is used internally in trellis.device, and can also be used as the theme argument to trellis.par.set, or even as theme in trellis.device to use the defaults for another device. canonical.theme is an alias for standard.theme.
standard.theme返回一个定义点阵显示图形参数设置的组件列表。它是用来在trellis.device内部,也可以使用themetrellis.par.set,甚至themetrellis.device使用默认的参数另一台设备。 canonical.theme是standard.theme别名。
col.whitebg returns a similar (but smaller) list that is suitable as the theme argument to trellis.device and trellis.par.set. It contains settings values which provide colors suitable for plotting on a white background. Note that the name col.whitebg is somewhat of a misnomer, since it actually sets the background to transparent rather than white.
col.whitebg返回一个类似,但规模较小的列表,是适合作为themetrellis.device和trellis.par.set参数。它包含了设定值,提供适合白色背景上绘制的颜色。请注意名称col.whitebg是有点名不副实,因为它实际上设置,而不是白色透明的背景。
注意----------Note----------
Earlier versions of trellis.device had a bg argument to set the background color, but this is no longer supported. If supplied, the bg argument will be passed on to the device function; however, this will have no effect on the Trellis settings. It is rarely meaningful to change the background alone; if you feel the need to change the background, consider using the theme argument instead.
早期版本的trellis.devicebg参数设置背景颜色,但这已不再支持。如果提供,bg参数将被传递到设备的功能,但是,这不会有任何效果,棚架上设置。它很少是有意义的单独改变背景,如果你觉得需要改变的背景下,考虑使用theme参数代替。
作者(S)----------Author(s)----------
Deepayan Sarkar <a href="mailtoeepayan.Sarkar@R-project.org">Deepayan.Sarkar@R-project.org</a>
参考文献----------References----------
Visualization with R, Springer. http://lmdvr.r-forge.r-project.org/
参见----------See Also----------
Lattice for an overview of the lattice package.
Latticelattice包的概述。
Devices for valid choices of device on your platform.
Devicesdevice你的平台上有效的选择。
trellis.par.get and trellis.par.set can be used to query and modify the settings after a device has been initialized. The par.settings argument to high level functions, described in xyplot, can be used to attach transient settings to a "trellis" object.
trellis.par.get和trellis.par.set可以用来查询和修改设置后,设备已初始化。 par.settings参数高层次的功能,在xyplot描述,可以使用附加瞬态设置"trellis"对象的。
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|