# Plot population on a world map

**URL:** <https://community.plotly.com/t/plot-population-on-a-world-map/2069>\
**Category:** 📊 Plotly Python\
**Created:** [September 9, 2016, 8:13am UTC](https://community.plotly.com/t/plot-population-on-a-world-map/2069 "2016-09-09T08:13:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gvallverdu](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/gvallverdu/32/548_2.png) [@gvallverdu](https://community.plotly.com/u/gvallverdu)\
**Post date:** [September 9, 2016, 8:13am UTC](https://community.plotly.com/t/plot-population-on-a-world-map/2069/1 "2016-09-09T08:13:17Z")

</div>

Hello

I tried to make a plot of the world wide population using choropleth maps. Here is a notebook about this :

> **[Jupyter Notebook Viewer](http://nbviewer.jupyter.org/github/gvallverdu/cookbook/blob/master/maps-world.ipynb)**
>
> Check out this Jupyter notebook!

In the documentation of the data I have dowloaded, they said that LocID is ISO-3 value. Thus I used this for the plot but it does not work. I wonder if the problem comes from here or if there is something else wrong.

Thanks

---

<div class="post-metadata">

**Author:** ![etienne](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/etienne/32/17_2.png) [@etienne](https://community.plotly.com/u/etienne)\
**Post date:** [September 9, 2016, 3:34pm UTC](https://community.plotly.com/t/plot-population-on-a-world-map/2069/2 "2016-09-09T15:34:43Z")

</div>

Not sure what went wrong, but those `LocID` items are numbers whereas `ISO-3` entries should be three-letter strings.

Looks like your data’s `Location` field correspond to (mostly) county name, so I’d recommend trying out [`locationmode: 'country name'`](https://plot.ly/javascript/reference/#choropleth-locationmode).

---

<div class="post-metadata">

**Author:** ![gvallverdu](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/gvallverdu/32/548_2.png) [@gvallverdu](https://community.plotly.com/u/gvallverdu)\
**Post date:** [November 3, 2016, 9:14pm UTC](https://community.plotly.com/t/plot-population-on-a-world-map/2069/3 "2016-11-03T21:14:59Z")

</div>

Hello  
Thank you etienne.  
I did another example with 3 letters strings and it works.  
I would like to know if you could advice a geojson tools to read geojson file ?

For example, I would like to plot french departements or regions on a map. I have a geojson file with coordinate of departement. I would like to be able to to a choropleth with this. Is this possible with plotlty and mapbox for example ?

Thanks

---

<div class="post-metadata">

**Author:** ![gvallverdu](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/gvallverdu/32/548_2.png) [@gvallverdu](https://community.plotly.com/u/gvallverdu)\
**Post date:** [November 19, 2016, 11:19pm UTC](https://community.plotly.com/t/plot-population-on-a-world-map/2069/4 "2016-11-19T23:19:11Z")

</div>

Hello  
After several research I find this (french) web site [portailsig.org](http://portailsig.org) and geopandas python library [http://geopandas.org/](http://geopandas.org/).

With geopandas you can easily read shape files which contains polygons corresponding to several division.

Finally, I did this plot : [http://gvallver.perso.univ-pau.fr/python/afpy\_europe.html](http://gvallver.perso.univ-pau.fr/python/afpy_europe.html)

Is there a way to make the map and the colorbar closer each other ?
