Sequential colour palette for a map plus one country gray

Hi there! I was wondering whether it's possible to plot a heat map of the world based on one numerical variable (I achieved that) plus having one country grayed out. I haven't found a solution for that online. I am using ggplot2 to plot the map. Thanks!

Consider creating a dummy feature, maybe something like this:

data = mutate(data,color_var=ifelse(country=="USA",T,F))

and then in ggplot set the color (or fill) argument to this feature,
and use the scale_fill_gradient to set the coloring gradient to your desired values.

I hope it helped.

Yes, I worked along those lines and it worked! Thanks for your help!

This topic was automatically closed 7 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.