2
$\begingroup$

I have the following code for labeling certain points at different latitude-longitude locations across the US stored in USLatLong.

GeoGraphics[{Red, PointSize[.01], Point@GeoPosition@USLatLong}]

Now I want to give each specific point on the map a label. These labels will be stored in some list, let's call it "labels". I am not sure how to do this since there isn't too much information on labeling points on GeoGraphics.

Thanks.

$\endgroup$
1
$\begingroup$

Here's one way to plot labeled points using GeoListPlot:

stockholm = GeoPosition[Entity["City", {"Stockholm", "Stockholm", "Sweden"}]["Coordinates"]];
gothenburg = GeoPosition[Entity["City", {"Goteborg", "VastraGotaland", "Sweden"}]["Coordinates"]];
malmo = GeoPosition[Entity["City", {"Malmo", "Skane", "Sweden"}]["Coordinates"]];

coords = {stockholm, gothenburg, malmo};
labels = {"Stockholm", "Gothenburg", "Malmö"};
labeledCoords = MapThread[Labeled, {coords, labels}];

GeoListPlot[labeledCoords]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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