Crapshot: Say I have some kind of data per country and I want to use Python or other FOSS tools to plot this on a good looking map at the country level. Is there a good tutorial for this? I ask because I can do virtually anything else with Python like data manipulation and analysis or plots, so I’d be nice to do this with Python too.
R is free & open source, and widely used for stats, data manipulation, analysis and plots. You can get geographical boundary data from GADM in RData format, and use R packages such as sp to produce charts easily.
Or at least, as easily as you can do anything in R. I hesitate to suggest it to people who already do data work in Python (it’s less … clean) but in this sort of domain it can do many things easily that are much harder or less commonly done in Python. My impression is the really whizzy, clever stats/graphics stuff is still all about R. (See e.g. this geographic example.) There are many tutorials, some of them very good in parts, but it’s famously slippery to get to grips with.
I know about R. In fact I switched from R to Python because R is less … clean. It looks like I will have to use R for plotting though the rest of the stack will be in Python.
Thanks for the reply. Basemap looks like what I want but it is not. It is surprisingly easy to plot arbitrary data on a world map but I didn’t manage to e.g. colour the countries of the world by some metric. If you look into basemap, please keep me posted.
P.S.: There is some tutorial that shows how to colour Italy’s regions seperately but I did not manage to colour in the whole world.
Crapshot: Say I have some kind of data per country and I want to use Python or other FOSS tools to plot this on a good looking map at the country level. Is there a good tutorial for this? I ask because I can do virtually anything else with Python like data manipulation and analysis or plots, so I’d be nice to do this with Python too.
I know it’s not FOSS or Python, but Google docs has exactly this feature built in to its spreadsheet application.
Looks like this might be like what you want.
R is free & open source, and widely used for stats, data manipulation, analysis and plots. You can get geographical boundary data from GADM in RData format, and use R packages such as sp to produce charts easily.
Or at least, as easily as you can do anything in R. I hesitate to suggest it to people who already do data work in Python (it’s less … clean) but in this sort of domain it can do many things easily that are much harder or less commonly done in Python. My impression is the really whizzy, clever stats/graphics stuff is still all about R. (See e.g. this geographic example.) There are many tutorials, some of them very good in parts, but it’s famously slippery to get to grips with.
More on spatial data in R. You can also get a long way with the maps and mapdata packages.
I know about R. In fact I switched from R to Python because R is less … clean. It looks like I will have to use R for plotting though the rest of the stack will be in Python.
Those maps look gorgeus!
You might want to look at basemap for matplotlib.
Disclaimer: I haven’t used this, (though I might start), but skimming over the synopses it looks like it will do what you want it to.
Thanks for the reply. Basemap looks like what I want but it is not. It is surprisingly easy to plot arbitrary data on a world map but I didn’t manage to e.g. colour the countries of the world by some metric. If you look into basemap, please keep me posted.
P.S.: There is some tutorial that shows how to colour Italy’s regions seperately but I did not manage to colour in the whole world.