Group Abstract Group Abstract

Message Boards Message Boards

Geographical Maps - replace an area with a density illustration

Posted 11 years ago

I have used the morphological components function: http://reference.wolfram.com/language/ref/MorphologicalComponents.html#41373480

(you can copy and paste the Africa map code in to Mathematica)

Once this is done I have the map with each area separated by a different colour. What I want to do is take a particular area (which corresponds to a particular colour in the map) and then replace it with a density plot (e.g. image of 400 points scattered uniformly in this area, of which 70% are blue and 30% are red).

Any idea how this can be done? Thanks!

POSTED BY: Priyan Fernando
4 Replies

Have you seen this example in documentation (below)? You can use scatter plots instead of flags.

flags = EntityValue[EntityClass["Country", "Africa"], {"Entity", "Flag"}]; 
GeoGraphics[{EdgeForm[Black], {GeoStyling[{"Image", #2}], 
     Tooltip[Polygon[#1], CommonName[#1]]} & @@@ flags}, 
 GeoBackground -> "StreetMapNoLabels"]

enter image description here

POSTED BY: Vitaliy Kaurov
Posted 11 years ago

you can set area = 100. I have edited the. code. Thanks

POSTED BY: Priyan Fernando

In your last code block variable area is undefined. Could not run it.

POSTED BY: Sam Carrettie
Posted 11 years ago
POSTED BY: Priyan Fernando
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard