0

I have a total of 90 sites with longitude/latitude coordinates. These sites are grouped into a total of 10 Koepen-Geiger climate classifications, with codes like "Af" and "Cb," etc. (If you know about this, you might realize that I have left a letter out of the classification scheme, but that's entirely okay for the purposes of this problem.)

What my code below does is to take the longitude and latitude of each site of coordinates, and then color its dot on the map based on its KG climate classification. It actually works like a charm, except for the fact that the colours I get are too similar (see the legend in the attached image.)

locations_of_sites = openxlsx::read.xlsx(*LOCATION OF EXCEL SHEET WITH COORDINATES + KG CLASSES*)

locations_of_sites = openxlsx::read.xlsx("/home/abed/Documents/research_papers_2021/Dec2022Discussion/top_level_data/all_sites_with_KG_classes.xlsx")
library(sf)
library(maps)

world = maps::map(database = "world")

worlddata = map_data("world")

myPaletter = magma(20)

ggplot() + geom_map(data = worlddata, map = worlddata, aes(long, lat, map_id = region),  fill = "lightgrey") + 
  geom_point(data = locations_of_sites, aes(longitude, latitude, col = 
                                              ((factor(Second_KG)))), alpha=1, size = 4) + 
  scale_color_manual(values = as.factor(locations_of_sites$Second_KG), name = "Second level \n KG classification")

You can see how some of the distinct classes have colours which are too similar

Abed
  • 183
  • 7
  • 2
    Have you considered `scale_color_brewer` instead? It has [built-in palettes](https://r-graph-gallery.com/38-rcolorbrewers-palettes.html) for up to 12 categories. – neilfws Jun 04 '23 at 23:10
  • 1
    For many options, have a look at the palettes included in paletteer. About 2/3 of the way down the page (there are hundreds of palettes) there are qualitative palettes with 10 or more colors. https://pmassicotte.github.io/paletteer_gallery/#qualitative – Jon Spring Jun 04 '23 at 23:47
  • 1
    Maybe my eyes are not that great, but ... can _you_ tell the difference between `BS` and `Cf`? There comes a point using color as a discrete discriminator that we lose the ability to distinguish some/many of the points. – r2evans Jun 05 '23 at 00:15

0 Answers0