image.plot(spectralGP)
image.plot()所属R语言包:spectralGP
Draws image plot with a legend strip for the color scale.
绘制图像绘图的颜色规模的一个传说条。
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function combines the SPLUS image function with some automatic placement of a legend. This is done by splitting the plotting region into two parts. Putting the image in one and the legend in the other.
此功能将S-PLUS图像功能,与一些自动放置一个传奇。这是通过分割成两部分的绘图区域。把图像于一体,并在其他的传说。
This function and help file are copied from the fields library.
此功能和帮助文件从库中复制。
用法----------Usage----------
image.plot(..., add = FALSE, nlevel = 64, legend.shrink = 0.9,
legend.width = 0.05, graphics.reset = FALSE, horizontal = FALSE,
offset = 2 * legend.width, bigplot = NULL, smallplot = NULL,
legend.only = FALSE, col = topo.colors(nlevel))
参数----------Arguments----------
参数:...
The usual arguments to the image function. because this function may change the size of the plotting region. (See details below)
通常的图像功能的参数。因为该函数可以改变绘图区的大小。 (详见下文)
参数:add
If true add image and a legend strip to the existing plot.
如果为true,添加图片和一个传奇条现有的图。
参数:nlevel
Number of color levels used in legend strip
数条传说中的色彩层次
参数:legend.shrink
Amount to shrink the size of legend relative to the full height or width of the plot.
金额缩小规模的传说相对于全高度或宽度的图。
参数:legend.width
Width in plotting coordinates (the full size plot is [0,1]X[0,1]) of the legend strip.
在绘制坐标(全尺寸的图是[0,1] X [0,1])的传说带的宽度。
参数:offset
Amount that the legend strip is set in from the left edge or the bottom of the plotting region. Units are with respect to the plotting coordinates.
图例片被设置在绘图区域的左边缘或底部金额。单位的绘制坐标。
参数:graphics.reset
If false (default) the plotting region ( plt in par) will not be reset and one can add more information onto the image plot. (e.g. using functions such as points or lines.) If true will reset plot parameters to the values before entering the function.
如果为false(默认值)的绘图区域(PLT在参数)不会被重置到的图像图和一个可以添加更多的信息。 (例如,使用功能,如点或线)如果为true,将重置绘图参数的值之前进入该功能。
参数:horizontal
If false (default) legend will be a vertical strip on the right side. If true the legend strip will be along the bottom.
如果为false(默认值),传说将是一个垂直条的右侧。如果为true,传说带将沿底部。
参数:bigplot
Plot coordinates for image plot. If not passed these will be determined within the function.
绘制图像绘图的坐标。如果不通过将这些函数内的确定。
参数:smallplot
Plot coordinates for legend. If not passed these will be determined within the function.
传说绘制坐标。如果不通过将这些函数内的确定。
参数:legend.only
If true just add the legend to a the plot in the plot region defined by the coordinates in smallplot.
如果真只是传说的图中的图所定义的坐标smallplot区域。
参数:col
Color table to use for image ( see help file on image for details). Default is a pleasing range of 64 divisions on a topgraphic scale.
颜色表用于图像(图像的详细信息,请参阅帮助文件)。默认情况下是一个可喜的范围内的64个部门上一个topgraphic的规模。
Details
详细信息----------Details----------
It is surprising how hard it is just to automatically add the legend! All "plotting coordinates" mentioned here are in device coordinates. The plot region is assumed to be [0,1]X[0,1] and plotting regions are defined as rectangles within this square. We found these easier to work with than user coordinates. There are always problems with default solutions to placing information on graphs but the choices made here may be useful for most cases. The most annoying thing is that after using plot.image and adding information the next plot that is made may have the slightly smaller plotting region set by the image plotting.
这是令人惊讶的,只是自动添加的传说是多么困难!所有“绘制坐标”这里所说的是在设备坐标。该图区域被认为是[0,1] X [0,1],绘制矩形区域被定义为在这个广场上。我们发现这些工作更容易比用户坐标。总有一些默认的解决方案的问题,将图上的信息,但在大多数情况下作出的选择可能是有用的。最可气的是,后使用plot.image和添加信息,接下来的图,可能有稍微小一点的图绘制绘制区域设置。
The strategy is simple, divide the plotting region into two smaller regions. The image goes in one and the legend in the other. This way there is always room for the legend. Some adjustments are made to this rule by not shrinking the image plot if there is already room for the legend strip and also sticking the legend strip close to the image plot. Also, one can specify the plot regions explicitly by bigplot and small plot if the default choices do not work. There may be problems with small plotting regions in fitting both of these plot and one may have to change the default character sizes or margins to make things fit.
的策略很简单,绘图区划分成两个较小的区域。的图像于一体,并在其他的传说。这种方式有永远的传说的空间。这条规则作出一些调整,而不是缩小图像绘图如果已经存在的传说条,还坚持的传说带的图像绘图。此外,可以指定明确的图区域由bigplot和积小,如果在默认情况下选择不工作。有可能是绘制的区域,在这些图都装配有可能有改变默认的字符的大小或利润,使东西适合与小的问题。
By keeping the zlim argument the same across images one can generate the same color scale. (See image help file) One useful technique for a panel of images is to just draw the first with image.plot to get a legend and just use image for subsequent plots. Also keep in mind one can just add a legend to an existing plot without changing plotting parameters. Usually a square plot (pty="s") done in a rectangular plot region will have room for the legend with any adjustments stuck to the right side.
通过保持的zlim的参数相同的跨越图像,可以产生相同的色标。 (请参阅帮助文件图像)的面板的图像是一个有用的技术,只画出了第一与image.plot到一个传奇,只是用图像的后续图。另外,保持心中一只是一个传说添加到现有的图没有改变绘图参数。一般一个正方形的图(控股=“s”)的矩形图区域在完成将有房间图例粘贴至右侧的任何调整。
副作用----------Side Effects----------
After exiting, the plotting region may be changed to make it possible to add more features to the plot. To be explicit, par()\$plt may be changed to reflect a smaller plotting region that includes a legend subplot.
退出后,在绘图区域可能会改变,使其能够增加更多的功能的图。要明确,标准杆(),\ $,PLT可能会改变,以反映更小的画图区域,其中包括传说中的插曲。
参见----------See Also----------
image
图像
实例----------Examples----------
x<- 1:10
y<- 1:15
z<- outer( x,y,"+")
image.plot(x,y,z)
# now add some points on diagonal [现在添加一些对角点]
points( 5:10, 5:10)
#[]
#fat (5% of figure) and short (50% of figure) legend strip on the bottom [脂肪图(5%)和短期的数字(50%)传说中的底部带]
image.plot( x,y,z,legend.width=.05, legend.shrink=.5, horizontal=TRUE)
# add a legend on the bottom but first change margin for some room [添加一些空间的底部,但第一个变化率由一个传说]
par( mar=c(10,5,5,5))
image( x,y,z)
image.plot( zlim=c(0,25), legend.only=TRUE, horizontal=TRUE)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|