使用levelplot在rasterVis中绘制分类数据时更改背景颜色(Change background colour when plotting categorical data in rasterVis using levelplot)
我有一个分类数据
(lulc)
用于土地使用土地覆盖有6个类别。 我试图在rasterVis
使用levelplot
绘制这些数据l<-as.factor(lulc) rat <- levels(l)[[1]] rat[["landcover"]] <- c("Agriculture", "Bare land", "Built-up", "Vegetation","Water","Wetland") levels(lulc) <- rat levelplot(lulc, col.regions=c("yellow","cyan","pink","green","lightblue","orange"), xlab="", ylab="")
但研究区域是沿海地区。 因此,我希望将NA显示为用“浅蓝色”代表的海洋。 我尝试了
panel.background="lightblue"
,但它没有改变剧情中的任何内容。 我得到的是以下;I have a categorical data
(lulc)
for a land use land cover having 6 classes. I am trying to plot this data usinglevelplot
inrasterVis
l<-as.factor(lulc) rat <- levels(l)[[1]] rat[["landcover"]] <- c("Agriculture", "Bare land", "Built-up", "Vegetation","Water","Wetland") levels(lulc) <- rat levelplot(lulc, col.regions=c("yellow","cyan","pink","green","lightblue","orange"), xlab="", ylab="")
But the study area is coastal. Hence I want to show NAs as ocean represented with "lightblue". I tried
panel.background="lightblue"
, but it does not change anything in the plot. What I get is following;
原文:https://stackoverflow.com/questions/35941573
最满意答案
这听起来像服务器限制您的请求,因为除脚本之外的所有内容总是在浏览器中异步加载。
可能是您只允许每秒从服务器获得如此多的带宽 - 或许多连接 - 这可能是服务器在您的第一个请求完成之前不会响应的原因。
检查您的服务器配置,并可能玩它以排除这种可能性。
This sounds like the server throttling your requests, as everything apart from scripts always load asynchronously in a browser.
It might be that you are only allowed so much bandwidth per second from the server - or so many connections - and that could be the reason why the server won't respond until your first request has finished.
Check your server configuration and perhaps have a play with it to exclude this possibility.
相关问答
更多-
使用video.js的HTML5视频在完全下载之前无法播放(HTML5 Video using video.js won't play until fully downloaded)[2022-12-14]
听起来IE浏览器不使用与其他浏览器相同的文件。 我不记得IE是否支持OGV文件,但如果不是IE应该使用你提供的mp4文件。 看来你的mp4没有为自动启动设置延迟。 我有时使用一个名为MP4box的程序来复用或解复用该文件,以便它可以在不加载所有内容的情况下启动。 It sounds like IE doesn't use the same file as other browsers. I don't remember if IE support OGV files but if not IE should ... -
Accept Ranges标头( writeHead()的位)是HTML5视频控件正常工作所必需的。 我想,而不是只是盲目地发送完整的文件,你应该首先检查在REQUEST中的Accept Ranges标题,然后读入并发送那一点。 fs.createReadStream支持start和end选项。 所以我尝试了一个例子,它的作品。 代码不漂亮,但很容易理解。 首先,我们处理范围标题以获取开始/结束位置。 然后我们使用fs.stat来获取文件的大小,而不fs.stat整个文件读入内存。 最后,使用fs.crea ...
-
在bootstrap模式关闭后,html5视频继续在后台播放(html5 video keeps playing in background after bootstrap modal closes)[2023-08-12]
尝试: $('#video-player').on('hide.bs.modal', function () { $('.video-body iframe')[0].contentWindow.postMessage('{"event":"command","func":"stopVideo","args":""}', '*'); }) Try: $('#video-player').on('hide.bs.modal', function () { $('.video-body iframe ... -
HTML5视频背景无效(HTML5 video background not working)[2022-11-25]
如果视频存储在与HTML相同的目录中,并且文件名正确,则应该没问题。 如果你已经在几个不同的浏览器中尝试过(我假设你有)那么,是的,它可能是视频编码。 Provided the videos are stored in the same directory as the HTML, and you have the filenames correct, this should be fine. If you've tried it in several different browsers (I assum ... -
试试这个vid.controls = false; Try this vid.controls = false;
-
一个问题可能是页面上有多个元素,但是您从示例页面获取的JS代码仅初始化第一个元素。 您应该使用document.querySelectorAll('video')并迭代每个视频元素。 编辑 - 这样的脏代码片段会起作用: var videos = document.querySelectorAll('video'); for (var i = 0; i < videos.length; i++) { var v = videos[i]; var sources = v.querySelect ...
-
这听起来像服务器限制您的请求,因为除脚本之外的所有内容总是在浏览器中异步加载。 可能是您只允许每秒从服务器获得如此多的带宽 - 或许多连接 - 这可能是服务器在您的第一个请求完成之前不会响应的原因。 检查您的服务器配置,并可能玩它以排除这种可能性。 This sounds like the server throttling your requests, as everything apart from scripts always load asynchronously in a browser. It ...
-
我不确定我是否完全符合您的要求,但听起来您正在寻找具有值cover的object-fit属性。 来自mdn: 盖 替换内容的大小可以在填充元素的整个内容框时保持其宽高比:其具体对象大小被解析为对元素的使用宽度和高度的封面约束。 html, body, div.video-container, video { height: 100%; width: 100%; margin: 0; padding: 0; box-sizing: border-box; } v ...
-
如何在播放前完整下载HTML5视频?(how to get a HTML5 video to download completely before playing? [duplicate])[2024-03-24]
我想这个答案可以被标记为重复,在这里你可以找到你的答案: 等到HTML5视频加载 I guess that this answer can be marked as duplicate, here you can find your answer: Wait until an HTML5 video loads -
如果您正在提供mp4,那么“立即”可能总会有一些延迟 - 客户端需要下载足够的视频才能播放而不进行缓冲(CloudFront等将有助于他们将缓存更接近用户) 您需要确保您的mp4文件已经过优化以获得最佳交付...您需要使用一些设置,但我建议确保MOOV元素位于文件的开头以帮助浏览器获取足够快的元数据。 我使用ffmpeg优化内容,通常是这些内容 ./ffmpeg -y -i SourceFile.mp4 -s 1280x720 -c:v libx264 -b 3M -strict -2 -movflags ...