Message Boards Message Boards

Geolabels function option usage

Posted 10 years ago

I'm a novice user trying to plot data values by IL counties. Used RegionValuePlot and obtained a color coded map. I would like to add labels at the Centroid of the polygons with values or text. Geolabels option set to true is too cluttered and displays the names of the counties. I'd rather plot the associated data values directly within the county areas. I noticed that Geolabels has a function option but could not find an example of its use in the online reference. Any pointers on using this option would be appreciated. Also any thoughts on embedding elements in a geopolygon will be very helpful.

4 Replies
Posted 10 years ago

How did you do it?

POSTED BY: John Pearson

There were several parts to my question. Keep in mind that I have been using Mathematica only for a few days and am learning the basics.

  1. As far as GeoLabels functions usage: There are examples that show the use of functions using Tooltip and Annotation. I took Tooltip as my building block and modified it to Inset.

There is an example (GeoLabels Documentation;; look under Scope). This example plots Atlanta, Savannah, and Naples.

I modified the GeoLabels to GeoLabels -> (Inset[#2, #2] &)] and that did the trick.

The Inset option output in my example is equivalent to what you get with setting GeoLabels -> True but with Inset I can set strings, and embed other types of objects. I have not had time to try more involved constructs

  1. The second part of my question has to deal with embedding values directly within my plot. I chose to do that by using shapedate and constructing a Graphics function. In the example below putnamcounty has polygon information. The Text value is an arbitrary value that I want to associate with putnamcounty, and the coords are the Geoposition data for a point within the polygon parted to provide lat, long coordinates. My initial attempts at passing coordinates to Text were frustrating because of mismatch between coordinate systems till I realized it and used Geoposition to provide that. Graphics[{{LightGray}, putnamcounty, Frame -> True, FontColor -> Red, Text[50, {coord[[1]], coord[[2]]}]}]

  2. So did I solve my problem completely? Not really as I have not put together the entire puzzle but I believe I have all the parts necessary to assemble it.

  3. I'd appreciate receiving additional information from those who are more sophisticated users than me.

Would you provide an overview of how you did it?

Someone will have a similar question and your solution could save that person a lot of time.

POSTED BY: Bruce Miller

Never mind. Figured it out. Thanks

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract