[英]how to set the ranges of coordinates X & Y for observation window geometry in spatstat package in R
[英]r how to set x and y ranges in an animation video generated with saveVideo
我使用下面的代碼制作 mpeg 視頻。 r.mean 是一個 spatRaster(terra 包中的柵格格式)
library(terra)
animation::saveVideo(animate(r.mean, n=1, pause = 0, sub = title_animate, col = rev(colorList), videoName_out))
我已經包含了動畫一幀的屏幕截圖。 實際圖像的上方和下方有很多空白區域。 我想將 y 范圍設置為 -60 到 90。我見過一個使用 saveVideo 的示例,它看起來像這樣,參數包含在 {}
saveVideo({
par(xxx, yy, zzz)},
some other stuff)
但我沒有任何運氣使這項工作成功。
問 R 問題時,請提供一個最小的、獨立的、可重現的示例(如下所示)。
示例數據
library(terra)
r <- rast(nlyrs=3)
values(r) <- rep(1:3, ncell(r))
您可以使用ani.height
和ani.width
參數。
animation::saveGIF(animate(r, n=1), ani.height=200, ani.width=300)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.