Making world map

Hello I want to make a world map like the picture with my data. I was wondering if anyone can help me with the code?

I would suggest to try with the different pieces.

  1. The worldwide choropleth: there are multiple examples where to get inspired. Google is your friend.
  2. The pie charts for the different continents
  3. Combine

Post here what you have done and eventually where you got stuck...
(Let's say it: your request is too generic and showing no effort on your side or any details [for example data])

Hi @enakkhistc, you could find better help if you put a reproducible example of data.
See this:

For start, you could make the basic map with this:


world_map <- getMap()

ggplot() +
  geom_polygon(data = world_map, aes(x = long, y = lat, group = group), fill = "white", color = "black") +
  coord_fixed(ratio = 1.3) +  # Adjust the ratio for better aspect
  theme_void()  # Remove background and axes

Hello @M_AcostaCH ,
Thank you for your advice.
I used this code with my specific data:

ggplot(merged_data, aes(x = long, y = lat, group = group, fill = value)) +
geom_polygon(color = "grey", size = 1) +
geom_polygon() +
scale_fill_gradient(low = "lightblue", high = "darkblue", na.value = "white") +

I have the outlines for the continents but I want the outline for all the countries like your picture.
Also, for some reason there is triangle in the middle of Africa that I cant seem to get rid of. Can you please look it over?

Thank you.

Without data is difficult make a good example for help you. Try to put a reproducible example of data.

I find an example of this map here:
see for avoid the triangle problems.

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.