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

R语言:trellis.par.get()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 22:00:31 | 显示全部楼层 |阅读模式
trellis.par.get(lattice)
trellis.par.get()所属R语言包:lattice

                                         Graphical Parameters for Trellis Displays
                                         网格显示的图形参数

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

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

Functions used to query, display and modify graphical parameters for fine control of Trellis displays.  Modifications are made to the settings for the currently active device only.
用格子显示的精细控制,查询,显示和修改图形参数的功能。修改设置为当前活动的设备只。


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


trellis.par.set(name, value, ..., theme, warn = TRUE, strict = FALSE)
trellis.par.get(name = NULL)
show.settings(x = NULL)



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

参数:name
A character string giving the name of a component.  If unspecified in trellis.par.get(), the return value is a named list containing all the current settings (this can be used to get the valid values for name).  
一个字符串的一个组成部分的名称。如果不指定在trellis.par.get(),返回值是一个列表,其中包含所有当前的设置(这可以用来得到有效值name)。


参数:value
a list giving the desired value of the component. Components that are already defined as part of the current settings but are not mentioned in value will remain unchanged.  
列表组件所需的值。已经定义为当前设置的一部分,但没有提及在value组件将维持不变。


参数:theme
a list decribing how to change the settings, similar to what is returned by trellis.par.get().  This is purely for convenience, allowing multiple calls to trellis.par.set to be condensed into one.  The name of each component must be a valid name as described above, with the corresponding value a valid value as described above.  As in trellis.device, theme can also be a function that produces such a list when called.  The function name can be supplied as a quoted string.  
列表decribing如何更改设置,类似什么是trellis.par.get()返回。这纯粹是为了方便,允许多个电话trellis.par.set被浓缩成一个。每个组件的名称必须是一个有效的name如上所述,与相应的值,有效的value如上所述。在trellis.device,theme也可以是一个函数调用时,产生这样一个列表。可以提供带引号的字符串的函数的名称。


参数:...
Multiple settings can be specified in name = value form. Equivalent to calling with theme = list(...)  
多种设置,可以指定在name = value的形式。相当于呼吁以theme = list(...)的


参数:warn
A logical flag, indicating whether a warning should be issued when trellis.par.get is called when no graphics device is open.  
一个逻辑标志,说明是否应发出警告,当trellis.par.get没有图形设备时,被称为是开放的。


参数:strict
Usually a logical flag, indicating whether the value should be interpreted strictly.  Usually, assignment of value to the corresponding named component is fuzzy in the sense that sub-components that are absent from value but not currently NULL are retained.  By specifying strict = TRUE, such values will be removed.  An even stricter interpretation is allowed by specifying strict as a numeric value larger than 1.  In that case, top-level components not specified in the call will also be removed.  This is primarily for internal use.  
通常是一个逻辑标志,指示是否应严格解释value。通常情况下,价值分配到相应的命名组件,子组件缺席value但目前没有NULL保留在这个意义上的模糊。通过指定strict = TRUE,这种价值将被删除。一个更严格的解释,允许通过指定strict数值比1较大。在这种情况下,不调用中指定的顶层组件也将被删除。这主要是供内部使用。


参数:x
optional list of components that change the settings (any valid value of theme).  These are used to modify the current settings (obtained by trellis.par.get) before they are displayed.  
更改设置(任何theme的有效值)的可选组件列表。这些都是用来修改当前设置(trellis.par.get获得)才显示。


Details

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

The various graphical parameters (color, line type, background etc) that control the look and feel of Trellis displays are highly customizable. Also, R can produce graphics on a number of devices, and it is expected that a different set of parameters would be more suited to different devices. These parameters are stored internally in a variable named lattice.theme, which is a list whose components define settings for particular devices. The components are idenified by the name of the device they represent (as obtained by .Device), and are created as and when new devices are opened for the first time using trellis.device (or Lattice plots are drawn on a device for the first time in that session).
各种图形参数(颜色,线条类型,背景等)控制的外观和感觉格子显示的是高度可定制的。此外,R可以生产设备的图形,并预期不同的参数集,会更适合于不同的设备。这些参数存储在内部变量名为lattice.theme,这是一个列表,其组件定义为特定设备的设置。组件是由他们所代表的设备的名称(如获得通过idenified .Device),并创建和新设备时,第一次使用打开trellis.device(或格图上绘制为首次在该届会议的设备)。

The initial settings for each device defaults to values appropriate for that device. In practice, this boils down to three distinct settings, one for screen devices like x11 and windows, one for black and white plots (mostly useful for postscript) and one for color printers (color postcript, pdf).
每个设备的默认值适用于该设备的初始设置。在实践中,这可以归结为三个不同的设置,像x11和windows,黑色和白色的图之一(主要是有用的postscript)和彩色打印机之一(屏幕设备颜色postcript,pdf)。

Once a device is open, its settings can be modified. When another instance of the same device is opened later using trellis.device, the settings for that device are reset to its defaults, unless otherwise specified in the call to trellis.device. But settings for different devices are treated separately, i.e., opening a postscript device will not alter the x11 settings, which will remain in effect whenever an x11 device is active.
一次设备是开放的,可以修改其设置。当同一设备的另一个实例打开后使用trellis.device该设备的设置复位到其默认值,除非另有调用trellis.device在指定。但设置为不同的设备分别处理,即打开一个PostScript设备将不会改变X11的设置,这将继续有效,每当X11设备处于活动状态。

The functions trellis.par.* are meant to be interfaces to the global settings. They always apply on the settings for the currently ACTIVE device.
职能trellis.par.*意思是全局设置的接口。他们总是适用于目前的有源器件的设置。

trellis.par.get, called without any arguments, returns the full list of settings for the active device. With the name argument present, it returns that component only. trellis.par.get sets the value of the name component of the current active device settings to value.
trellis.par.get,不带任何参数调用,返回的有源器件设置的完整列表。与name参数目前,它仅返回该组件。 trellis.par.get设置name当前的活动设备设置value组件的值。

trellis.par.get is usually used inside trellis functions to get graphical parameters before plotting. Modifications by users via trellis.par.set is traditionally done as follows:
trellis.par.get通常使用内部网格功能之前绘制的图形参数。修改用户通过trellis.par.set传统如下:

add.line <- trellis.par.get("add.line")
add.line <- trellis.par.get("add.line")

add.line$col <- "red"
add.line$col <- "red"

trellis.par.set("add.line", add.line)
trellis.par.set("add.line", add.line)

More convenient (but not S compatible) ways to do this are
更方便(但不是S兼容)的方式来做到这一点

trellis.par.set(list(add.line = list(col = "red")))
trellis.par.set(list(add.line = list(col = "red")))

and


trellis.par.set(add.line = list(col = "red"))
trellis.par.set(add.line = list(col = "red"))

The actual list of the components in trellis.settings has not been finalized, so I'm not attempting to list them here. The current value can be obtained by print(trellis.par.get()). Most names should be self-explanatory.
实际的组件列表trellis.settings尚未最后确定,所以我不会试图在这里一一列举。当前值可以得到print(trellis.par.get())。大多数的名称应该是不言自明。

show.settings provides a graphical display summarizing some of the values in the current settings.
show.settings总结一些在当前的设置值提供了一个图形显示。


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

trellis.par.get returns a list giving parameters for that component. If name is missing, it returns the full list.
trellis.par.get返回给该元件的参数列表。如果name缺少,它返回的完整列表。


注意----------Note----------

In some ways, trellis.par.get and trellis.par.set together are a replacement for the par function used in traditional R graphics.  In particular, changing par settings has little (if any) effect on lattice output.  Since lattice plots are implemented using Grid graphics, its parameter system does have an effect unless overridden by a suitable lattice parameter setting. Such parameters can be specified as part of a lattice theme by including them in the grid.pars component (see gpar for a list of valid parameter names).
在某些方面,trellis.par.get和trellis.par.set是par在用于传统&#341;图形功能的替代。尤其是改变par设置有小(如有)的晶格输出效果。由于晶格图是实现电网图形,其参数系统确实有一个合适的晶格参数设置的影响,除非重写。这些参数可以被指定为的晶格主题的一部分,包括他们在grid.pars组件(见gpar一个有效的参数名称列表)。


作者(S)----------Author(s)----------


Deepayan Sarkar <a href="mailtoeepayan.Sarkar@R-project.org">Deepayan.Sarkar@R-project.org</a>



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

trellis.device, Lattice, gpar
trellis.device,Lattice,gpar


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


show.settings()

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-23 10:29 , Processed in 0.037670 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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