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

R语言 Rgraphviz包 plot-methods()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-22 20:54:12 | 显示全部楼层 |阅读模式
plot-methods(Rgraphviz)
plot-methods()所属R语言包:Rgraphviz

                                         Plot a graph object - methods
                                         画出一个图形对象 - 方法

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

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

A plot method for graph objects.
一个graph对象图法。


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



<p><code>'graph': plot(x, y, ..., subGList=list(), attrs=list(),
    nodeAttrs=list(), edgeAttrs=list(), xlab="", ylab="", main=NULL,
    sub=sub, recipEdges=c("combined", "distinct"))</code>
</p>
<p><code>'Ragraph': plot(x, y, ..., xlab="", ylab="", main=NULL,
    sub=sub, drawNode=drawAgNode, nodeAttrs=list(), edgeAttrs=list())</code>
</p>



参数----------arguments----------




x The graph object to plot
xgraph对象绘制




y The layout method to use: One of dot, neato, twopi, circo, and
&#376;使用的布局方法:一个dot,neato,twopi,circo,和




subGList A list of subgraphs taken from the primary graph object to be plotted.  If provided, these subgraphs
subGList一个主graph对象的子图绘制的列表。如果提供的,这些子图




attrs A list of Graphviz attributes to be sent to the layout engine
属性一个列表ATTRS的GraphViz的被发送到布局引擎




nodeAttrs A list of attributes for specific nodes
nodeAttrs特定节点的属性列表




edgeAttrs A list of attributes for specific edges
edgeAttrs一个特定的边缘属性列表




xlab Label for the x axis of the plot
XLab中标签为x轴的图




ylab Label for the y axis of the plot
ylab标签为y轴的图




main Main label for the plot
图主要的主要标签




sub Subtitle for the plot
子字幕的图




drawNode Function to draw the nodes.  The default is
drawNode函数来绘制节点。默认是




recipEdges Determines how to draw reciprocating edges.  See
recipEdges确定如何绘制往复式边缘。见




... General commands to be sent to plot
...一般命令被发送到绘制


详情----------details----------

The first plot method in the usage section corresponds to the graph class in the graph package.  It will convert the graph object into an object of class Ragraph by using Graphviz to perform the layout.  Then it will call the plot method for Ragraph.  The plot.graph method is nothing more then a wrapper that calls agopen and plot.Ragraph.
usage类graph包graph部分的第一条曲线的方法对应。 graph使用Graphviz执行布局,将其转换成一个类的对象Ragraph对象。然后,它会调用图Ragraph方法。 plot.graph方法是什么然后调用agopen和plot.Ragraph包装。

The second plot method in the usage section is for the Ragraph class, which describes a Graphviz structure of a graph.  This method will extract necessary information from the object and use it to plot the graph.
在第二个图usage部分方法是Ragraph类,它描述了一个图Graphviz的结构。这种方法从对象中提取必要的信息,并用它来绘制图形。

Users can specify arbitrary drawing functions for the nodes of the Ragraph with the drawNode argument, although caution is urged.  The default drawing function for  all nodes is drawAgNode, which will draw a basic circle, ellipse or rectangle according to the layout specifications for each node. If supplying a custom function, users are encouraged to look at the code of this function for a more clear picture of the information required to properly draw a node.   Users can specify either one custom function to be used for all nodes or a list (where length is equal to the nubmer of nodes) of functions where the Nth element in the list provides the drawing function for the Nth node, and every function will take four parameters - the first is an object of class AgNode representing the node itself and the second is an object of class xyPoint representing the upper right corner of the Graphviz plotting region (where the lower left is 0,0). The third parameter, attrs is a node attribute list and represents post-layout attribute changes where the user wants to override values present in the layout.  The last argument, radConv is a divisor to the radius and is used to convert from Graphviz units to R plotting units.  Outside of the first argument, the rest of these (particularly radConv which generally shouldn't be specifically set) do not need to be set by the user, but any drawing function must have them as parameters.
用户可以指定与Ragraph参数drawNode节点任意的绘图功能,虽然敦促谨慎。所有节点的默认绘图功能是drawAgNode,这将绘制一个基本的圆形,椭圆形或长方形,根据每个节点的布局规范。如果提供一个自定义的功能,鼓励用户看为正确绘制节点所需的信息更加清晰的画面,这功能的代码。用户可以指定任何一个自定义函数可用于所有节点或列表的功能列表中的第N个元素为N个节点提供的绘图功能(长度等于节点2-14),每个功能将四个参数 - 第一个是对象类AgNode代表节点本身和第二类对象xyPoint代表Graphviz的绘图区域的右上角(左下角是0,0)。第三个参数,attrs是一个节点的属性列表和代表布局后的属性变化,用户要覆盖布局中存在的值。最后一个参数,radConv是一个半径除数,用于转换到RGraphviz单位,策划单位。的第一个参数外,其余这些特别radConv这一般不应该被专门设置不必须由用户设置的,但任何绘图功能,必须有他们作为参数。

The attrs list requires a particular format.  It must be of length 3 with names graph, node, and edge.  Each of these elements themselves are lists - such that an element of graph corresponds to a graph element.  A full listing of attributes and their possible settings is available at http://www.research.att.com/~erg/graphviz/info/attrs.html.  All attribute values should be entered as character strings (even if the requested value is to be otherwise).
attrs列表需要一个特定的格式。它必须与名称长度为3graph,node,edge。这些元素本身的列表 - graph元素对应一个图形元素。全面上市的属性和其可能的设置是在http://www.research.att.com/~erg/graphviz/info/attrs.html。所有的属性值应输入字符串(即使请求的值是要不然的话)。

The nodeAttrs list is used to specify attributes on a particular node, instead of for all nodes.  The format of this list is such that the elements correspond to attributes (the name of the element is used to note which attribute) and each element contains a named vector.  The names of the vector denote which nodes are having this attribute set and the values in the vector specify the value.
nodeAttrs列表是用来指定一个特定的节点上的属性,而不是对所有节点。这份列表的格式是这样的元素对应属性(元素的名称,使用时要注意哪些属性),每个元素包含一个名为向量。向量的名称表示该节点有此属性集和向量的值指定值。

The edgeAttrs list is identical in format to nodeAttrs. However, the name of the edges is in a particular format where an edge between x and y is named x~y.  Note that even in an undirected graph that x~y is not the same as y~x - the name must be in the same order that the edge was defined as having.  
edgeAttrs名单是在格式nodeAttrs相同。然而,边缘的名称是在一个特定的格式,其中X和Y之间的边缘被命名为x~y。请注意,即使是在一个无向图x~y是不一样的y~x - 名称必须是在边缘被定义为具有相同的顺序。


值----------value----------

The Ragraph object used for plotting
Ragraph绘图对象


作者----------author----------

Jeff Gentry
杰夫·金特里


seealso----------seealso----------

graphNEL-class, graph-class
graphNEL-class,graph-class


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


#  WHY DOES THIS NOT WORK IN CHECK?[为什么这不是在检查工作?]
#  V &lt;- letters[1:10][[V] < - 信[1:10]]
#  M &lt;- 1:4[M“ -  1:4]
#  g1 &lt;- randomGraph(V, M, .2)[G1 < -  randomGraph(五,男,.2)]
#  plot(g1)[图(G1)]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-22 16:12 , Processed in 0.035591 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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