【发布时间】:2021-05-24 22:30:34
【问题描述】:
我目前正在分析某些指数对世界国家 (134) 的影响。此效果的范围为 (-1.01, 0.528)。鉴于“效果 = 0”位于调色板的右侧,它与绿色和黄色之间的变化不重合,因此该地图具有误导性。
-
如何在调色板的刻度中“居中”值 0?为 0 区域上的这些值分配某种颜色会很神奇(除了大小,在我的分析中,正或负是至关重要的)。
-
有没有办法为负值制作“红色”调色板,为正值制作“绿色”调色板?
-
如何删除标题“index_effect”?
有什么线索吗?
谢谢
注意:我使用此代码的视频在此处https://www.youtube.com/watch?v=8dNBWESwcHU
我得到的代码和图如下:
# set the colour
colourPalette <- RColorBrewer::brewer.pal(10,'Spectral')
# plot the info in the world map ("world_data" is my dataset)
mapCountryData(world_data,
nameColumnToPlot = 'index_effect',
catMethod = 'fixedwidth',
mapRegion = 'world',
colourPalette = 'diverging',
numCats = 10)
【问题讨论】:
标签: r ggplot2 plot palette rworldmap