2
$\begingroup$

I am trying to create a GeoRegionValuePlot-like graph with:

  1. Land coloured Red or Blue, depending on a numerical value.
  2. Thin black borders around the states.
  3. A white background, showing nothing but the states I want to draw.

My closest attempt is to not use GeoRegionValuePlot at all:

GeoGraphics[{
  (* Want Red *)
  Polygon[Entity["AdministrativeDivision", {"NewSouthWales", "Australia"}]],
  (* Want Blue *) 
  Polygon[Entity["AdministrativeDivision", {"Victoria", "Australia"}]],      
  EdgeForm[{Thick, Black}]
}, 
  GeoBackground -> White]

With GeoRegionValuePlot, the best that I can do so far is GeoBackground -> None, or GeoBackground -> {"CountryBorders", "Border" -> Black}, but the latter option draws things other than the two states that I want. For example,

GeoRegionValuePlot[{Entity[
    "AdministrativeDivision", {"NewSouthWales", "Australia"}] -> 1.5,
  Entity["AdministrativeDivision", {"Victoria", "Australia"}] -> 2}, 
 GeoBackground -> {"CountryBorders", "Border" -> Black},]

Q: How to custom style the land and borders of a GeoRegionValuePlot?

$\endgroup$

1 Answer 1

1
$\begingroup$

At the last second, I came across a solution thanks to modifying this answer. I'm posting it here in case others need this kind of visualtion.

f[x_] := Piecewise[{{Red, x < 2}}, Blue]; (* Rule: Red if val < 2, Blue otherwise *)

states = {Entity["AdministrativeDivision", {"NewSouthWales", "Australia"}], 
          Entity["AdministrativeDivision", {"Victoria", "Australia"}]};
vals = {1, 3};

GeoGraphics[MapThread[{EdgeForm[Black], f[#1], Polygon[#2]} &, {vals, states}], 
 GeoBackground -> White]

If you want the colours to have Opacity[1] (and for more general styling), use GeoStyling[]. For example,

GeoGraphics[
MapThread[{GeoStyling[f[#1]], EdgeForm[Directive[White, Thick]], Polygon[#2]} &,
 {vals, states}
  ], 
 GeoBackground -> White
]

$\endgroup$

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.