I'd like to plot locations using longitude and latitude coordinates using Python or C++, is there a good library for such a task?

I know that matplotlib is an option, I'm wondering if there are any others?


4 Answers 4


Mapnik is a c++ toolkit for making maps and has python bindings – http://mapnik.org


If you're looking for something that's really easy to use and your lat/long data come from a shapefile, you could check out the Python Geographic Visualizer (GeoVis) module. It has no dependencies, requires no installation, and is very easy to use. In the newest version you can also zoom in on specific areas and symbolize based on attribute classification:

import geovis
# 2 DATA
countrylayer = geovis.Layer("C:/polygons_shapefile.shp")
countrylayer.AddClassification(symboltype="fillcolor", valuefield="pop_est", symbolrange=[geovis.Color("white"),geovis.Color("red", intensity=0.9, brightness=0.8),geovis.Color("red", intensity=0.9, brightness=0.5)], classifytype="natural breaks", nrclasses=3)
# 3 MAP
newmap = geovis.NewMap()
newmap.AddLegend(countrylayer, upperleft=(0.03,0.15), bottomright=(0.6,0.4))
newmap.AddText(relx=0.5, rely=0.05, text="Population, by Country", textsize=0.1, textanchor="n", textboxfillcolor=geovis.Color("white"))

...will show you a screen with something like this about 2 seconds later...

enter image description here


Try mapnik if you really need this to be done in python otherwise use http://www.mapsdata.co.uk to plot your geo-spatial data on map. It support variety of gis formats including lat/lon.


Then there's the CartoPy library from the MetOffice. Based on matplotlib, with support for Shapely.

There was a presentation on it at FOSS4G in Nottigham, but I can't seem to find the recording on YouTube yet

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.