R語言學(xué)習(xí)記錄:rasterVis包繪制柵格調(diào)整colorkey
1.可以選擇不繪制colorkey(默認(rèn)也是F)
2.可以選擇繪制默認(rèn)colorkey
3.自定義設(shè)置colorkey
自己翻譯一下:
由于rasterVis包是基于lattice的,所以colorkey的參數(shù)和lattice一樣,(具體細(xì)節(jié)可以看lattice包的levelplot函數(shù)的解釋)。
此外,在rasterVis包的levelplot函數(shù)添加了一個(gè)在lattice包的levelplot函數(shù)沒有的特點(diǎn),rasterVis包的levelplot函數(shù)可以添加title參數(shù)(character),還有title.gpar參數(shù)(list)(具體細(xì)節(jié)看gpar,應(yīng)用于標(biāo)題文本)。

OK,現(xiàn)在再去找lattice的文檔找一下levelplot里面的colorkey的解釋

space:上下左右
xy:位置參數(shù),已經(jīng)棄用
col:顏色漸變規(guī)范,和level.colors函數(shù)的col.regions參數(shù)一樣
at:數(shù)值向量。指定在哪顏色開始變化,必須必顏色向量大1
tri.lower, tri.upper:邏輯或數(shù)值,控制colorbar的形狀的兩段是否是三角形還是矩形。對(duì)于默認(rèn)值(NA),只有當(dāng)相應(yīng)的極端值分別為-Inf或Inf,并且三角形占總長度的5%時(shí),才會(huì)發(fā)生這種情況。如果是數(shù)字和在0到0.25之間,則給出相應(yīng)的分?jǐn)?shù),當(dāng)指定為TRUE時(shí),同樣為5%。
labels:用于標(biāo)記at值的字符向量。或者更常見的是描述標(biāo)簽特征的列表。此列表可能包括組件標(biāo)簽、at、cex、col、rot、font、fontface和fontfamily
title:通常是字符向量,或者是表達(dá)式,或者是控制詳細(xì)信息的list,或者是一個(gè)任意的grob(grid graphical objects)。list的詳細(xì)解釋請(qǐng)參見For details of how the list form is interpreted, see the entry for main in xyplot。
generally speaking, the actual label should be specifified as the label component (which may be unnamed if it is the fifirst component), and the remaining arguments are used as appropriate in a call to textGrob.
一般來說,實(shí)際的標(biāo)簽應(yīng)該指定為標(biāo)簽組件(如果它是第一個(gè)組件,則可能未命名),其余的參數(shù)在對(duì)textGrob的調(diào)用中適當(dāng)使用。
Further control of the placement of the title is possible through the component title.control. In particular, if a rot component is not specifified, its default depends on the value of title.control$side (0 for top or bottom, and 90 for left or right).
通過title.control,可以進(jìn)一步控制標(biāo)題的位置。特別地,如果未指定rot(逆時(shí)針旋轉(zhuǎn)角度)組件,其默認(rèn)值取決于title.control中side的值
title(我也不知道為什么會(huì)有兩個(gè)title component):A list providing control over the placement of a title, if specifified. Currently two components are honoured: side can take values "top", "bottom", "left", and "right", and specififies the side of the colorkey on which the title is to be placed. Defaults to the value of the "space" component. padding is a multiplier for the default amount of padding between the title and the colorkey.
如果指定的話,它是一個(gè)列表,這個(gè)列表控制colorkey標(biāo)題位置。目前有兩個(gè)component,side=上下左右,并且side還指定colorkey的標(biāo)題在colorkey的哪一邊。默認(rèn)值和space component的值一樣。(最后一句我不知道怎么翻譯,機(jī)翻的話就是:填充是標(biāo)題和colorkey之間的默認(rèn)填充量的乘積)(這段話我理解的是兩個(gè)component分別是side和padding,但是這倆我都試了,不報(bào)錯(cuò)也沒反應(yīng))
tick.number:The approximate number of ticks desired。所需的大致tick數(shù)目(我不明白為什么會(huì)用“大約”來描述)tick是刻度的意思
tck:A (scalar) multipler for tick lengths.刻度長度
corner:與xy交互,尚未實(shí)現(xiàn)
width:colorkey的寬度
height:The length of key as a fraction of the appropriate side of plot.? colorkey的長度作為圖的適當(dāng)部分的一部分。
raster:A logical flag indicating whether the colorkey should be rendered as a raster image using grid.raster. See also panel.levelplot.raster.一個(gè)邏輯標(biāo)志,指示colorkey是否應(yīng)該使用grid.raster渲染為光柵圖像。另請(qǐng)參見panel.levelplot.raster。
interpolate: Logical flag, passed to rasterGrob when raster=TRUE.
axis.line: A list giving graphical parameters for the color key boundary and tick marks. Defaults to trellis.par.get("axis.line").
axis.text: A list giving graphical parameters for the tick mark labels on the color key. Defaults to trellis.par.get("axis.text").

現(xiàn)在再去找xyplot里面的main參數(shù)的解釋

總結(jié):真rlnm了!就擱這無窮套娃唄,寫個(gè)解釋文檔跟要了你命似的,參見這個(gè)參見那個(gè)的,rnm!