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

R语言:pie()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 20:36:34 | 显示全部楼层 |阅读模式
pie(graphics)
pie()所属R语言包:graphics

                                        Pie Charts
                                         饼图

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

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

Draw a pie chart.
绘制饼图。


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


pie(x, labels = names(x), edges = 200, radius = 0.8,
    clockwise = FALSE, init.angle = if(clockwise) 90 else 0,
    density = NULL, angle = 45, col = NULL, border = NULL,
    lty = NULL, main = NULL, ...)



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

参数:x
a vector of non-negative numerical quantities. The values in x are displayed as the areas of pie slices.
一个非负数值数量的向量。 x值显示为扇形区域。


参数:labels
one or more expressions or character strings giving names for the slices.  Other objects are coerced by as.graphicsAnnot.  For empty or NA (after coercion to character) labels, no label nor pointing line is drawn.
一个或多个表达式或字符串片的名称。其他对象被强制as.graphicsAnnot。为空或NA(后强迫字符)标签,没有标签,也没有指向线绘制。


参数:edges
the circular outline of the pie is approximated by a polygon with this many edges.
有很多边的多边形近似圆形轮廓的馅饼。


参数:radius
the pie is drawn centered in a square box whose sides range from -1 to 1.  If the character strings labeling the slices are long it may be necessary to use a smaller radius.
饼图绘制集中在一个方盒子,其两侧范围从-11。如果标记切片的字符串是长期的,它可能需要使用一个较小的半径。


参数:clockwise
logical indicating if slices are drawn clockwise or counter clockwise (i.e., mathematically positive direction), the latter is default.
逻辑表示,如果切片绘制顺时针或逆时针(即数学积极的方向),后者是默认。


参数:init.angle
number specifying the starting angle (in degrees) for the slices. Defaults to 0 (i.e., "3 o'clock") unless clockwise is true where init.angle defaults to 90 (degrees), (i.e., "12 o'clock").
片指定的起始角度(度)的数量。默认为0(即3点),除非clockwise是真实的init.angle默认为90(度),(例如,12点)。


参数:density
the density of shading lines, in lines per inch. The default value of NULL means that no shading lines are drawn. Non-positive values of density also inhibit the drawing of shading lines.
阴影线的密度,以每英寸线。默认值NULL意味着没有阴影线绘制。 density非正面的价值观也抑制了阴影线绘图。


参数:angle
the slope of shading lines, given as an angle in degrees (counter-clockwise).
遮光线的斜率,角度(逆时针)。


参数:col
a vector of colors to be used in filling or shading the slices. If missing a set of 6 pastel colours is used, unless density is specified when par("fg") is used.
颜色矢量将用于填补或遮光片。如果缺少一套6柔和的色彩,除非density时par("fg")用于指定的。


参数:border, lty
(possibly vectors) arguments passed to polygon which draws each slice.
(可能是向量)的参数传递给polygon吸引每个切片。


参数:main
an overall title for the plot.
图的总冠军。


参数:...
graphical parameters can be given as arguments to pie.  They will affect the main title and labels only.
图形参数可以给出作为pie的参数。他们将影响主标题和标签只。


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

Pie charts are a very bad way of displaying information. The eye is good at judging linear measures and bad at judging relative areas.  A bar chart or dot chart is a preferable way of displaying this type of data.
饼图是一个非常糟糕的方式显示信息。映入眼帘的是善于判断直线措施和坏的判断相对面积。条形图或点图表是一个最好的方式显示这种类型的数据。

Cleveland (1985), page 264: “Data that can be shown by pie charts always can be shown by a dot chart.  This means that judgements of position along a common scale can be made instead of the less accurate angle judgements.” This statement is based on the empirical investigations of Cleveland and McGill as well as investigations by perceptual psychologists.
克利夫兰(1985年),第264页“,可以通过饼图显示的数据总是可以通过一个点图所示。规模沿着一个共同的立场判断,这意味着可以作出判断,而不是不准确的角度。“这句话是在克利夫兰和麦吉尔大学的实证调查以及知觉心理学家的调查为基础。


参考文献----------References----------

The New S Language. Wadsworth & Brooks/Cole.
The Elements of Graphing Data. Wadsworth: Monterey, CA, USA.

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

dotchart.
dotchart。


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


require(grDevices)
pie(rep(1, 24), col = rainbow(24), radius = 0.9)

pie.sales <- c(0.12, 0.3, 0.26, 0.16, 0.04, 0.12)
names(pie.sales) <- c("Blueberry", "Cherry",
    "Apple", "Boston Cream", "Other", "Vanilla Cream")
pie(pie.sales) # default colours[默认颜色]
pie(pie.sales, col = c("purple", "violetred1", "green3",
                       "cornsilk", "cyan", "white"))
pie(pie.sales, col = gray(seq(0.4,1.0,length=6)))
pie(pie.sales, density = 10, angle = 15 + 10 * 1:6)
pie(pie.sales, clockwise=TRUE, main="pie(*, clockwise=TRUE)")
segments(0,0, 0,1, col= "red", lwd = 2)
text(0,1, "init.angle = 90", col= "red")

n <- 200
pie(rep(1,n), labels="", col=rainbow(n), border=NA,
    main = "pie(*, labels=\"\", col=rainbow(n), border=NA,..")

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-24 08:35 , Processed in 0.023089 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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