1
$\begingroup$

I would like to know how to replace the color of the ocean, while keeping the borders between different countries, i.e. replace the blue into transparent color (see the figure). I tried doing it with ColorReplace, but it also changes the colors of the borders.

Hera an example of the code:

vals={
 GeoVariant[Entity["Country", "Spain"], "SimplifiedArea"] -> 11.1268, 
 GeoVariant[Entity["Country", "Peru"], "SimplifiedArea"] -> 6.03548, 
 GeoVariant[Entity["Country", "Lithuania"], "SimplifiedArea"] -> 4.07754, 
 GeoVariant[Entity["Country", "Iraq"], "SimplifiedArea"] -> 2.19722, 
 GeoVariant[Entity["Country", "Libya"], "SimplifiedArea"] ->0.693147
}

plot = Show[
 GeoRegionValuePlot[vals, GeoRange -> {{-60, 90}, {-170, 190}}, ImageSize -> 900]]

enter image description here

$\endgroup$
1
  • 1
    $\begingroup$ Show isn't necessary, and hasn't been for a long time. $\endgroup$
    – rcollyer
    Commented Mar 2, 2017 at 14:40

1 Answer 1

4
$\begingroup$

What you are looking to do is to change the background of your image, and when you are looking for information on GeoBackground you need to know that it is often a proxy for GeoStyling. From the docs, there are two styles added in v11 which accept additional direction: "Coastlines" and "CountryBorders". For example,

GeoRegionValuePlot[vals, GeoRange -> {{-60, 90}, {-170, 190}}, 
 GeoBackground -> {"CountryBorders", "Land" -> White, 
   "Ocean" -> LightBlue, "Border" -> Lighter@Gray}]

enter image description here

$\endgroup$
5
  • $\begingroup$ Thanks but If I use the code GeoRegionValuePlot[vals, GeoRange -> {{-60, 90}, {-170, 190}}, GeoBackground -> {"CountryBorders", "Land" -> White, "Ocean" -> LightBlue, "Border" -> Lighter@Gray}] I get the following image. Any help? I'm running mathematica 10 (i.sstatic.net/XhFKe.png) $\endgroup$ Commented Mar 2, 2017 at 16:01
  • $\begingroup$ Hi, thanks for the answer. If I use your code I get a map I attached in the answer. Any help? $\endgroup$ Commented Mar 2, 2017 at 16:02
  • $\begingroup$ Ah, yes, you must be using v10.4, or earlier. I'll make a note that my solution is v11+. $\endgroup$
    – rcollyer
    Commented Mar 2, 2017 at 16:05
  • $\begingroup$ 10.4. Solution for that?@rcollyer $\endgroup$ Commented Mar 6, 2017 at 16:19
  • $\begingroup$ @GiorgioColangelo unfortunately, I don't have a good solution for it. I'll have to play with it to see if I can generate a better solution. $\endgroup$
    – rcollyer
    Commented Mar 6, 2017 at 16:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.