matplotlib / basemap

Plot on map projections (with coastlines and political boundaries) using matplotlib
MIT License
775 stars 392 forks source link

Updated fillstates.py to add Alaska and Hawaii as map insets #366

Closed jsh9 closed 6 years ago

jsh9 commented 7 years ago

I modified the example so that the map output imitates the map shown here (basically, Alaska and Hawaii are shown on the bottom left corner of the main map as small insets): https://en.wikipedia.org/wiki/List_of_U.S._states_by_population_density

I based my modifications partly on some code snippets in this stackoverflow thread (https://stackoverflow.com/questions/39742305/how-to-use-basemap-python-to-plot-us-with-50-states).

story645 commented 7 years ago

I love this in theory 'cause I forgot too late I left out states, but is there anyway to refine this example so it's not quite this complicated?

jsh9 commented 7 years ago

I thought about it and I don't think the code can be simplified much while maintaining the look of the map.

I added three elements: (1) Alaska and Hawaii (2) Light gray lines to bound Alaska and Hawaii so that people know that they are map insets (3) Color bar showing what each color means

Each of the three elements are essential to a scientifically complete map, and the codes I wrote for each of the three elements are already quite simple. Also, for (1) and (2), I choose to use Mercator projection, because (a) this projection makes Alaska look "upright" instead of "tilted", and (b) enables me to draw straight gray lines on the map.

jsh9 commented 7 years ago

Made a new commit just now. Suggestions welcome!

WeatherGod commented 6 years ago

Sorry this sat for so long! Hurricane season distracted me and I forgot to get back to this. Thanks for your contribution!