Reputation: 836
I am currently analysing the effect of certain indexes over world countries (134). This effect ranges from (-1.01, 0.528). Given that "effect = 0" is located to the right of the Palette, it does not coincide with the change between greens and yellows and therefore the map is misleading.
How can I "center" the value 0 in the scale of the palette? Would be amazing to assign a certain color for those values on the region of 0 (apart from the size, being positive or negative is of crucial importance in my analysis).
Is there a way of make a palette of "reds" for negative values and a palette of "greens" for the positive ones?
How can I remove the title "index_effect"?
Any clue?
Thank you
Note: The video I have followed to work with this code is here https://www.youtube.com/watch?v=8dNBWESwcHU
The code and the plot I have obtained is the following:
# 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)
Upvotes: 1
Views: 184
Reputation: 836
Upvotes: 1