legend.bubbles(rysgran)
legend.bubbles()所属R语言包:rysgran
Add Legends to Bubble Plots
传奇气泡图
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This functions can be used to add legends to bubble plots
此功能可用于添加传说气泡图
用法----------Usage----------
legend.bubbles (x, y = NULL, z = NULL, nleg = NULL, digits = NULL,
pch, z.cex.range = NULL, x.intersp = 1, y.intersp = 1, ...)
参数----------Arguments----------
参数:x, y
the x and y co-ordinates to be used to position the legend. They can be specified by keyword or in any way which is accepted by xy.coords. The location may also be specified by setting x to a single keyword from the list "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right" and "center". This places the legend on the inside of the plot frame at the given location. Partial argument matching is used. The optional inset argument specifies how far the legend is inset from the plot margins. If a single value is given, it is used for both margins; if two values are given, the first is used for x- distance, the second for y-distance
的x和y坐标,以用来定位图例。它们可以被指定的关键字,或以任何方式接受了该xy.coords。也可以指定该位置可以由x设置为一个单一的关键字列表“bottomright”,“底部”,“bottomleft”,“左”,“左上”,“顶部”,“topright” ,“右”和“中心”。这个地方的传说在里面的图框架,在给定的位置。部分参数匹配。可选的嵌入参数指定多远,传说是从图中边缘插图。如果给出一个单一的值,它是用于左右边距,如果两个值都给出了,第一个是用于x距离,第二个为y距离
参数:z
a numeric vector whose values were used to define the points expansion factor (bubbles) of the plot
一个数值向量,其值被用来定义的点扩展系数(气泡)的图
参数:nleg
integer indicating the number of values (quantiles) to be drawn in the legend. The default is "3" which will return the minimum, median and maximum values of z (quantiles 0, 50 and 100 percent, respectively)
整数表示的值的个数(位数)要绘制的传说。默认值是“3”,它会返回最低,中位数和最大值z(0分位数,50%和100%,分别)
参数:digits
integer indicating the number of decimal places to be used on legend. Default is "1"
整数的小数位数传奇。默认为“1”
参数:pch
the plotting symbols appearing in the legend, either as vector of 1-character strings, or one (multi character) string. Must be the same used on plotting
绘图符号出现在传说中,无论是作为向量的1个字符的字符串,或一个字符串(多字符)。必须是相同的使用的打印
参数:z.cex.range
vector of length 2. Minimum and maximum 'cex' of the bubbles plotted. Replace the argument pt.cex. Must be the same used on plotting
矢量的长度为2。最小和最大的CEX的气泡绘制。更换的说法pt.cex。必须是相同的使用的打印
参数:x.intersp
character interspacing factor for horizontal (x) spacing
字符间距因子水平(x)的间距
参数:y.intersp
the same for vertical (y) line distances
垂直(y)线的距离为相同
参数:...
further graphical parameters. See legend() for additional options
进一步的图形参数。额外的选项传说()
Details
详细信息----------Details----------
This is a "wrapper" function for legend() that adds bubbles - legend() should be consulted for details.legend.bubbles was designed to plot legends to bubbles for the rysgran.plot and rysgran.ternary functions. For this, the values of z, z.cex.range and pch should be the same used to plot the graph and legend.bubbles. To avoid problems with overlapping symbols and characters due to the different sizes of pch, arguments x.intersp, y.intersp and cex should be adjusted accordingly. Note that the option 'bty="n"' from legend is hardcoded to avoid overlapping
这是一个“包装”的传说(),增加了泡沫 - 传说()应详细咨询。legend.bubbles的目的是要绘制的传说气泡的rysgran.plot和rysgran.ternary功能。对于这一点,z,z.cex.range和pch应该是相同的,用于绘制图形和legend.bubbles。为了避免重叠的符号和字符的问题,由于不同大小的pch,参数x.intersp,y.intersp和cex应作相应调整。需要注意的是选项“BTY =”N“传说是硬编码,以避免重叠
注意----------Note----------
legend.bubbles depends on the package 'soiltexture'
legend.bubbles取决于上包“soiltexture”
(作者)----------Author(s)----------
Eliandro R. Gilbert (<a href="mailto:eliandrogilbert@gmail.com">eliandrogilbert@gmail.com</a>)
参见----------See Also----------
rysgran.plot, rysgran.ternary
rysgran.plot,rysgran.ternary
实例----------Examples----------
#Shepard diagram with Sorting as bubbles[谢泼德图作为气泡排序]
#Calculating the percentage of weight in each textural class[的重量百分比计算在每个纹理类]
library(rysgran)
data(camargo2001)
percent <- class.percent(camargo2001, mode="total")
#Calculating the grain size statistics[计算的晶粒尺寸统计]
rys <- gran.stats(camargo2001 , method="folk")
#Plotting[绘图]
rysgran.ternary (x = percent[2:4], method = "shepard",
z = rys$Sorting, z.cex.range = c(0.5,4), col = "blue", pch = 20)
legend.bubbles ("topright", z=rys$Sorting , nleg=4, pch=20, col="blue",cex=1,
z.cex.range=c(0.5,4), x.intersp=1.2, y.intersp=1.2,digits=1, title="Sorting")
#Bivariated Plot[Bivariated图]
#Mean and Sorting with Kurtosis as bubbles[平均和排序与峰度气泡]
library(rysgran)
data(camargo2001)
#Calculating the grain size statistics[计算的晶粒尺寸统计]
rys <- gran.stats(camargo2001 , method="folk")
#Ploting[图]
rysgran.plot ("mean" , "sort" , data=camargo2001, method="folk", pch = 21,
col = "red", z=rys$Kurtosis, z.cex.range=c(1,5),bg="red")
legend.bubbles ("bottomright", z=rys$Kurtosis , nleg=3, pch=21, col="black",
z.cex.range=c(1,5), x.intersp=1.3, y.intersp=1.6, digits=1, title="Kurtosis")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|