quick.map(SDMTools)
quick.map()所属R语言包:SDMTools
Quick Map
快速图
译者:生物统计家园网 机器人LoveR
描述----------Description----------
quick.map creates and displays an image, identifying the threshold as the background color, and create the gradient legend in the map.
quick.map创建和显示图像的背景颜色,标识阈值,并创建渐变传说中的图。
用法----------Usage----------
quick.map(sdm.asc, threshold, bkgd.col = 'grey',
cols=heat.colors(100), zlim=NULL, pnts=NULL, ...)
参数----------Arguments----------
参数:sdm.asc
an object of class 'asc' (adehabitat package), 'RasterLayer' (raster package) or 'SpatialGridDataFrame' (sp package)
对象类ASC(adehabitat包),的“RasterLayer”(栅格包)或“SpatialGridDataFrame(SP包)
参数:threshold
to indicate the threshold limit of sdm.asc
表示的阈值限制sdm.asc
参数:bkgd.col
to specify the background color
指定的背景色
参数:cols
a set of 2 or more colors to be used in the image and the gradient legend
一组中的2个或更多图像中使用的颜色和梯度图例
参数:zlim
to specify the upper an lower limits, which are going to be the labels of the gradient legend
指定的上下限,将要的渐变的图例的标签
参数:pnts
location information for adding the legend.gradient
位置信息添加legend.gradient
参数:...
other graphical parameters defined by image() or plot()
其他图形参数的图像()或plot(定义)
Details
详细信息----------Details----------
An image is created of the map requested. A gradient legend (legend.gradient) will be added if pnts (the position of the legend) is specified.
一种图像创建的图请求。渐变的传说(legend.gradient)将被添加pnts(指定的位置为传奇)。
值----------Value----------
Nothing is returned, an image is created.
则返回Nothing,图像被创建。
(作者)----------Author(s)----------
Lorena Falconi <a href="mailto:lorefalconi@gmail.com">lorefalconi@gmail.com</a>
实例----------Examples----------
#create a matrix[创建一个矩阵]
tmat = { matrix(c( 0,0,0,1,0,0,1,1,0,1,
0,0,1,0,1,0,0,0,0,0,
0,1,NA,1,0,1,0,0,0,1,
1,0,1,1,1,0,1,0,0,1,
0,1,0,1,0,1,0,0,0,1,
0,0,1,0,1,0,0,1,1,0,
1,0,0,1,0,0,1,0,0,0,
0,1,0,0,0,1,0,0,0,1,
0,0,1,1,1,0,0,1,1,1,
1,1,1,0,0,0,0,1,1,1),nr=10,byrow=TRUE) }
#do the connected component labeling[做连接的组件标签]
tasc = ConnCompLabel(tmat)
#put in the gradient scale[梯度规模的投入]
pnts = cbind(x =c(1.1,1.2,1.2,1.1), y =c(0.9,0.9,0.7,0.7))
# Set the map and gradient leyend colors [设置的图和梯度leyend的颜色]
tasc.col=colorRampPalette(c("yellow","orange", "red"))(5)
#Create an image with the gradient legend[创建的梯度传说图像]
quick.map(tasc,0.09,bkgd.col = 'darkgrey', cols=tasc.col,
axes=FALSE, xlim=c(0.0,1.35))
#########################[########################]
# Create an image with two colors: below the threshold and [创建一个图像有两种颜色:低于阈值,]
# above the threshold[高于该阈值]
# The next version of SDM Tools will let you create the legend.gradient [下一个版本的SDM工具可以让你创建legend.gradient]
# at a specific side of your image, and the user would not need to set [您的图像,并且用户将在一个特定的侧不需要设置]
# the coordinates.[的坐标。]
# To create the legend.gradient at the bottom left of your image without [要创建在您的图像的左下角没有legend.gradient]
# setting up the coordinates at the image you can do this:[坐标的图像,你可以这样做:]
xlim = c(-0.5,1)
ylim = c(0,1)
wid = diff(xlim)*0.05
ht = diff(ylim)*0.1
xvals = c(xlim[1]+wid,xlim[1]+2*wid,xlim[1]+2*wid,xlim[1]+wid)
yvals = c(ylim[1]+ht,ylim[1]+ht,ylim[1]+2*ht,ylim[1]+2*ht)
#Create the points for the legend.gradient[创建的legend.gradient点]
pnts=(cbind(xvals,yvals))
# Set the images colors: above the threshold is black and [设置图像颜色:超过阈值是黑色的,]
# below the threshold is darkgrey.[低于阈值darkgrey。]
quick.map(tasc,0.09,bkgd.col = 'darkgrey', cols="black",
axes=FALSE, xlim=c(-0.8, 1))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|