问题描述
我在 tmap 中创建了所有伦敦绿地接入点的地图,并通过颜色在地图上显示了靠近接入点的犯罪数量。但是,最终输出如图所示。
绿地接入点和犯罪活动地图
分类器中每个颜色变化之间的中断没有显示我希望实现的变化(当前中断是 (1,501,1001,15001,2000)。相反,我想将这些中断更改为 (1,100,500,1000,2000). 无论如何我可以这样做,因为我在网上查看但没有找到答案。地图输出的代码如下:
tm_shape(London_Ward_shp) +
tm_fill(palette = "grey") +
tm_borders(alpha=.3,col = "white") +
tm_shape(London_GS_Access_Points_Public) +
tm_bubbles(size = 0.05,col = "crime_2020",style = "pretty",scale = 1) +
tm_layout(main.title= "2020 Crime Levels near Public Park/Garden Access Points in London",main.title.fontface = 1,fontfamily = "Helvetica",legend.outside = TRUE,legend.position = c("right","bottom"),legend.title.size = 1,legend.title.fontface = 1,frame = FALSE)
提前致谢!
解决方法
您需要调整 style
参数并在 breaks
调用中添加tm_bubbles()
参数:
tm_bubbles(size = 0.05,col = "crime_2020",style = "fixed",scale = 1,breaks = c(1,100,500,1000,2000)
)