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

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

[复制链接]
发表于 2012-2-22 21:04:23 | 显示全部楼层 |阅读模式
renderGraph(Rgraphviz)
renderGraph()所属R语言包:Rgraphviz

                                        Render a laid out graph object
                                         呈现奠定了图形对象

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

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

This method uses the renderInfo slot of a graph object to render it on a plotting device. The graph must have been laid out using the layoutGraph function before.
此方法使用一个图形对象renderInfo槽呈现在打印设备。图必须已铺设使用前layoutGraph功能。


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



## S4 method for signature 'graph'
renderGraph(x, ..., drawNodes="renderNodes", drawEdges=renderEdges, graph.pars=list())




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

参数:x
An object derived from class graph
从类graph派生的对象


参数:drawNodes
A function that is used for the node rendering. The details of its API are still undecided, so far the input to the function is the (laid out) graph object. Defaults to renderNodes, which is not exported in the name space (type Rgraphviz:::renderNodes to see the function definition). This default function knows how to draw node shapes of type box, rectangle, ellipse, plaintext, circle and triangle. In addition, an arbitrary user-defined function can be passed on to draw the node. This function needs to be able to deal with the following arguments: a two-by-two matrix of the bounding box for the respective node, and labelX, labelY, fill, col, lwd, lty, textCol, style, label and fontsize, which are all defined by the layout algorithm or are graphical nodeRenderInfo parameters.  
一个节点渲染使用的功能。其API的细节仍然未定,到目前为止输入的功能是奠定了图形对象。默认renderNodes名字空间(类型Rgraphviz:::renderNodes看到函数的定义),这是不出口。此默认功能,知道如何绘制形状节点类型box,rectangle,ellipse,plaintext,circle和triangle。此外,任意一个用户定义的功能可以通过绘制节点。此功能需要能够处理下列参数:为各节点的包围盒的两个两个矩阵,labelX,labelY,fill,col,lwd,lty,textCol,style,label和fontsize,这是所有的布局算法定义或图形nodeRenderInfo参数。


参数:drawEdges
A function that is used for the edge rendering. Defaults to renderEdges. Currently, this function can draw different types of arrowheads: open, normal, dot, odot, box, obox, tee, diamond, odiamond and none. In addition, a user-defined function can be passed as arrowhead or arrowtail parameters which needs to be able to deal with 4 arguments: A list of xy coordinates for the center of the arrowhead, and the graphical parameters col, lwd and lty.  
一个边缘呈现的功能。 renderEdges默认。目前,此功能可以得出不同类型的箭头:open,normal,dot,odot,box,obox,<X >,tee,diamond和odiamond。此外,用户定义的函数可以通过none或arrowhead参数,需要能够处理4个参数:xy的名单,协调中心的箭头,图形参数arrowtail,col和lwd。


参数:graph.pars
A list of rendering parameters to use as defaults. Parameters that have been explicitely set using nodeRenderInfo, edgeRenderInfo or graphRenderInfo take precendence. If not explicitely supplied, the value of a call to graph.par is used. This design allows to set session-wide defaults.  
渲染参数使用默认列表。已明确设定使用nodeRenderInfo,edgeRenderInfo或graphRenderInfo采取precendence的参数。如果不明确地提供价值调用graph.par一个使用。这种设计允许设置会话的默认。


参数:...
further arguments
进一步的论据


Details

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

This method can render graph objects that have previously been laid out using the function layoutGraph. The details for user defined node drawing remain to be decided.
这种方法可以使图形先前已使用的功能layoutGraph奠定了对象。用户定义的节点图纸的细节仍有待决定。


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

An object derived from class graph with information about the coordinates of the nodes in the coordinate system of the plotting device added to the renderInfo slot.
从类派生的对象graphrenderInfo插槽打印设备坐标系统中的节点的坐标信息。


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


Florian Hahne



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

layoutGraph, link[graph:renderInfo-class]{nodeRenderInfo},  link[graph:renderInfo-class]{edgeRenderInfo}, link[graph:renderInfo-class]{graphRenderInfo},
layoutGraph,link[graph:renderInfo-class]{nodeRenderInfo},link[graph:renderInfo-class]{edgeRenderInfo},link[graph:renderInfo-class]{graphRenderInfo}


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



library(graph)
set.seed(123)
V <- letters[1:5]
M <- 1:2
g1 <- randomGraph(V, M, 0.5)
edgemode(g1) <- "directed"
x <- layoutGraph(g1)
renderGraph(x)

## one of Graphviz's additional layout algorithms[Graphviz的额外的布局算法]
x <- layoutGraph(g1, layoutType="neato")
renderGraph(x)

## some tweaks to Graphviz's node and edge attributes,[#Graphviz的节点和边的属性的一些调整,]
## including a user-defined arrowhead and node shape functions.[#包括一个用户定义的箭头和节点形函数。]
myArrows <- function(x, ...)
{
for(i in 1:4)
points(x,cex=i)
}

myNode <- function(x, col, fill, ...)
symbols(x=mean(x[,1]), y=mean(x[,2]), thermometers=cbind(.5, 1,
runif(1)), inches=0.5,
fg=col, bg=fill, add=TRUE)

eAtt <- list(arrowhead=c("a~b"=myArrows, "b~d"="odiamond", "d~e"="tee"))
nAtt <- list(shape=c(d="box", c="ellipse", a=myNode))
edgemode(g1) <- "directed"
x <- layoutGraph(g1, edgeAttrs=eAtt, nodeAttrs=nAtt, layoutType="neato")
renderGraph(x)



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


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

使用道具 举报

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

本版积分规则

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

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

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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