highlightMatplot(SVGAnnotation)
highlightMatplot()所属R语言包:SVGAnnotation
Make a matplot interactive, highlighting a series when mouse over
使matplot互动,突出了一系列当鼠标悬停
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function is for making an matrix plot or parallel coordinates plot interactive by allowing the viewer to mouse over a series to highlight it by enlarging its width and potentially changing its color. This helps to identify individual series when they are heavily overlayed and "tangled".
此功能是矩阵图或平行坐标图互动,让观众通过一系列鼠标突出扩大其宽度,并有可能改变其颜色。这有助于确定个人系列时,他们大量叠加和“纠结”。
The function getMatplotSeries is a lower-level function that can be used to find the SVG nodes that correspond to the polylines that draw each series. Each series will have a single node. One can fetch these nodes with this function and then, e.g., add tooltips, associate them with legend items, etc.
功能getMatplotSeries是一个低级别的功能,可以用来找到SVG节点对应于每个系列的折线,画。每个系列都将有一个单一的节点。一个可以获取这些节点和具有这种功能,如添加工具提示,关联图例项,等等。
用法----------Usage----------
highlightMatplot(doc, color = "null", factor = 3, series = getMatplotSeries(doc),
ids = seq(along = series),
js = system.file("JavaScript", "imatplot.js", package = "SVGAnnotation"))
参数----------Arguments----------
参数:doc
the SVG document (or the name of a file which contains the SVG document)
SVG文件(或文件名,其中包含的SVG文档)
参数:color
a string giving a color (in JavaScript notation) that is used when highlighting a series to change the color of the line to that color.
给人一种颜色的字符串(JavaScript中的符号),突出了一系列改变这种颜色的线的颜色时使用。
参数:factor
a scaling factor as a number that is used to change the width of the line for the highlighted series. One can use a value of 1.0 to specify no change in width.
作为一个用来改变线的宽度,突出系列的数量比例因子。你还可以使用没有指定宽度的变化值1.0。
参数:series
a list of XML nodes identifying the poly-lines for each series. Each series has a single node. One can fetch these from the plot using the function getMatplotSeries.
确定每个系列的聚线的XML节点列表。每个系列都有一个单一的节点。一个可以获取这些从使用功能getMatplotSeries图。
参数:ids
a vector of values that are used as id attributes on the XML nodes in series.
用于XML节点在series的id属性值向量。
参数:js
the JavaScript code to add to the plot
添加到图的JavaScript代码
值----------Value----------
The updated SVG document.
更新后的SVG文档。
作者(S)----------Author(s)----------
Duncan Temple Lang
参见----------See Also----------
matplot
matplot
举例----------Examples----------
if(require(MASS)) {
doc = svgPlot(parcoord(mtcars))
highlightMatplot(doc, "red")
saveXML(doc, "imtcars.svg")
}
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|