1

I wrote a code for data science and I got some coordinates that I want to plot on google maps. These are the coordinates, and all of these coordinates are in capitol city of Serbia called Belgrade.

        X          Y
 20.657460  44.490140
 20.510760  44.652443
 20.510540  44.884460
 20.471758  44.788613
 20.359841  44.742405
 20.472120  44.763520
 20.610525  44.676290

How can I plot these data on google maps so that I can see locations of these coordinates on google maps? I tried with matplotlib, and with some Santdex tutorials and with pygmapsbut I failed. I could not intall pygmaps

1 Answer 1

5

You can use gmplot to plot data with Google Maps.

To do so, install with pip install gmplot.

Then, the code should look like :

from gmplot import gmplot

# Initialize the map at a given point
gmap = gmplot.GoogleMapPlotter(37.766956, -122.438481, 13)

# Add a marker
gmap.marker(37.770776, -122.461689, 'cornflowerblue')

# Draw map into HTML file
gmap.draw("my_map.html")

You can see gmplot repo to see how to use it.

Sign up to request clarification or add additional context in comments.

1 Comment

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.