Scatter Maps with Plotly and Mapbox

Post navigation

The Case Study

This example uses a sample of Sri Lankan police station data to map which police stations were attacked by rebel groups in the 1971 revolt. The codes for this map are simple but useful for small amounts of data. The final product is here: https://plot.ly/~wdeng1/165.embed. You can also see my codes on GitHub.

The final product would look something like the picture below. If you have more data, you can also set up empty lists and then use the pandas append function to append data to those lists, then use an “if” loop to append colors to a colors list.