如何更改我的 t_map 对象图例中的中断

问题描述

我在 tmap 中创建了所有伦敦绿地接入点的地图,并通过颜色在地图上显示了靠近接入点的犯罪数量。但是,最终输出如图所示。

绿地接入点和犯罪活动地图

enter image description here

分类器中每个颜色变化之间的中断没有显示我希望实现的变化(当前中断是 (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))

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...