R - 等高线图
我有一个等高线图,我想知道是否可以标记各个等高线级别以及颜色? (也就是说,第一个粉红色轮廓是 0.2,第二个是 0.4 或任何有效的值)。
另外,将土地填充为纯色的论据是什么?
library(lattice)
contourplot(cor_Warra_SF_SST_SON, region=TRUE, at=seq(-1, 1, 0.2),
labels=FALSE, row.values=lon_sst, column.values=lat_sst,
xlab='longitude', ylab='latitude')
I have a contour plot, I am wondering is it possible to label the individual contour levels as well as the colours? (i.e. say the first pink contour is 0.2, second is 0.4 or whatever works).
Also, what is the argument for filling land as a solid color?
library(lattice)
contourplot(cor_Warra_SF_SST_SON, region=TRUE, at=seq(-1, 1, 0.2),
labels=FALSE, row.values=lon_sst, column.values=lat_sst,
xlab='longitude', ylab='latitude')
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要包含等高线的标签,只需设置
labels = TRUE
(代替您当前使用的labels=FALSE
)。?contourplot
记录了labels
参数:要为大陆添加填充多边形,我尝试使用
latticeExtra
包中的mapplot()
,将其添加到您已经使用layer 生成的绘图中()
,也来自latticeExtra
。 (如果无法访问您正在使用的数据,我无法获得比这更具体的信息。)To include labels for the contour lines, simply set
labels = TRUE
(in place of thelabels=FALSE
that you are currently using).?contourplot
document thelabels
argument thusly:To add filled polygons for the continents, I'd try using
mapplot()
from thelatticeExtra
package, adding it to the plot you're already produced usinglayer()
, also fromlatticeExtra
. (I can't get much more specific than that without having access to the data you are using.)