我有这段代码:
tm_shape(usa, bbox = bbox, projection = map.crs)+
tm_borders(col = "grey", lwd = 1) +
tm_fill(palette = "grey") +
tm_grid(x = c(-77,-75,-73,-71),
y = c(39,37,35),
labels.inside.frame = F,
labels.size = 1.1,
col = "white") +
tm_layout(outer.margins = c(.1,.03,.05,.05),
outer.bg.color = "white")+
tm_shape(sk.dat1,axes = T) +
tm_dots("DATELAND", palette = colo,
auto.palette.mapping=FALSE,
size = .5,
breaks = seq(2010,2017,
length.out =8),legend.show = T, alpha=.7) +
tm_layout(title = "Southern Kingfish Occurrence",
legend.show = T,
legend.position = c("right","bottom"),
legend.bg.color = "grey70",
legend.height = 2)
哪个输出legend。如何将tmap输入更改为仅包含没有逗号的单年?
答案 0 :(得分:2)
这看起来像数字格式问题;你的代码不是完全可重复的,所以我不能100%肯定,但我相当肯定。
要解决此问题,请在tm_layout
来电中尝试:
legend.format=list(fun=function(x) formatC(x, digits=0, format="d"))
顺便说一下,我在几个月前写了关于tmap
传奇格式的短篇博文(我的问题是货币和百分号)。