私は湖のクロロフィルマップを生成しています。私は、葉にクロロフィル濃度が非常に低い青色を、NA値に淡青色を塗りたい。私にna.value='blue'
ため、このようなプロットを与えるgplotでバックグラウンドとNA値の色を区別する方法
gplot(Chlorophyll_map_5) + geom_tile(aes(fill=value)) + scale_fill_gradient(low = 'blue', high = 'red', na.value='blue',name="Chl-a (ug/l)",limits=c(0,1000)) + coord_equal()+theme_bw()
以下に示すように私は、コードを使用しています:
私はこの画像だna.value='transparent'
を使用します。
na.valueの色を変更すると背景も変わります。背景を変えずに湖を色で塗りつぶす方法はありますか?私のデータの
出力: `私のデータの出力:文書毎の
Formal class 'RasterLayer' [package "raster"] with 12 slots
[email protected] file :Formal class '.RasterFile' [package "raster"] with 13 slots
.. .. [email protected] name : chr "/private/var/folders/68/hm_5ts9x7psb6j3wnb91_bfr0000gn/T/RtmpZ3BLZD/raster/r_tmp_2017-07-18_133827_28365_34843.grd"
.. .. [email protected] datanotation: chr "FLT8S"
.. .. [email protected] byteorder : Named chr "little"
.. .. .. ..- attr(*, "names")= chr "value"
.. .. [email protected] nodatavalue : num -1.7e+308
.. .. [email protected] NAchanged : logi FALSE
.. .. [email protected] nbands : int 1
.. .. [email protected] bandorder : Named chr "BIL"
.. .. .. ..- attr(*, "names")= chr "value"
.. .. [email protected] offset : int 0
.. .. [email protected] toptobottom : logi TRUE
.. .. [email protected] blockrows : int 0
.. .. [email protected] blockcols : int 0
.. .. [email protected] driver : chr "raster"
.. .. [email protected] open : logi FALSE
[email protected] data :Formal class '.SingleLayerData' [package "raster"] with 13 slots
.. .. [email protected] values : logi(0)
.. .. [email protected] offset : num 0
.. .. [email protected] gain : num 1
.. .. [email protected] inmemory : logi FALSE
.. .. [email protected] fromdisk : logi TRUE
.. .. [email protected] isfactor : logi FALSE
.. .. [email protected] attributes: list()
.. .. [email protected] haveminmax: logi TRUE
.. .. [email protected] min : num 0.00335
.. .. [email protected] max : num 3870657
.. .. [email protected] band : int 1
.. .. [email protected] unit : chr ""
.. .. [email protected] names : chr "layer"
[email protected] legend :Formal class '.RasterLegend' [package "raster"] with 5 slots
.. .. [email protected] type : chr(0)
.. .. [email protected] values : logi(0)
.. .. [email protected] color : logi(0)
.. .. [email protected] names : logi(0)
.. .. [email protected] colortable: logi(0)
[email protected] title : chr(0)
[email protected] extent :Formal class 'Extent' [package "raster"] with 4 slots
.. .. [email protected] xmin: num 35.8
.. .. [email protected] xmax: num 36.7
.. .. [email protected] ymin: num 2.4
.. .. [email protected] ymax: num 4.65
[email protected] rotated : logi FALSE
[email protected] rotation:Formal class '.Rotation' [package "raster"] with 2 slots
.. .. [email protected] geotrans: num(0)
.. .. [email protected] transfun:function()
[email protected] ncols : int 3240
[email protected] nrows : int 8321
[email protected] crs :Formal class 'CRS' [package "sp"] with 1 slot
.. .. [email protected] projargs: chr "+proj=longlat +ellps=WGS84 +no_defs"
[email protected] history : list()
[email protected] z : list()
私は、背景を私が見ることから変えていません。あなたの地図データはどのように見えますか?あなたはその箱入りエリア全体に亘ってNAを持つかもしれません。 – troh
Landsat 8 OLI/TIRS画像をダウンロードし、回帰モデルを適用しました。どのように私は箱の区域全体にNAの価値を取り除き、湖だけを保つのでしょうか?私は前に湖のshapefileで画像を切り取った。 –
データの 'str'の出力を表示できますか? – troh