# Posts for Tag: animation

### Assembling the USA state-by-state with state-level statistics

Posted In: Maps

#### Watch the United States assemble state by state based on statistics of interest

Based on earlier popularity of the country-by-country animation, this map lets you watch as the world is built-up one state at a time. This can be done along a large range of statistical dimensions:

• Name (alphabetical)
• abbreviation
• Date of entry to the United States
• State Population (2018)
• Population per Electoral Vote (2018)
• Population per House Seat (2018)
• Land Area (square miles)
• Population Density (ppl per sq mi) (2018)
• State’s Highest Point
• Highest Elevation (ft)
• Mean Elevation (ft)
• State’s Lowest Point
• Lowest Point (ft)
• Life Expectancy at Birth (yrs)
• Median Age (yrs)
• Percent with High School Education
• Percent with Bachelor’s Degree
• Residential Electricity Price (cents per kWh) (2018)
• Gasoline Price ($/gal) Regular unleaded (2019) • State Gross Domestic Product GDP ($Million) (2018)
• GDP per capita (\$/capita)
• Number of Counties (or subdivisions)
• Average Daily Solar Radiation (kWh/m2)
• Birth rate (per thousand population)
• Avg Age of Mother at Birth
• Annual Precipitation (in/yr)
• Average Temperature (deg F)
• These statistics can be sorted from small to large or vice versa to get a view of the US and its constituent states plus DC in a unique and interesting way. It’s a bit hypnotic to watch as the states appear and add to the country one by one.

You can use this map to display all the states that have higher life expectancy than the Texas:
select “Life expectancy”, sort from “high to low” and use the scroll bar to move to the Texax and you’ll get a picture like this:

or this map to display all the states that have higher population density than California:
select “Population density, sort from “high to low” and use the scroll bar to move to the United States and you’ll get a picture like this:

I hope you enjoy exploring the United States through a number of different demographic, economic and physical characteristics through this data viz tool. And if you have ideas for other statistics to add, I will try to do so.

• Population https://en.wikipedia.org/wiki/List_of_states_and_territories_of_the_United_States_by_population
• Educational attainment https://nces.ed.gov/programs/digest/d18/tables/dt18_104.88.asp
• Highest points https://geology.com/state-high-points.shtml
• Life expectancy https://en.wikipedia.org/wiki/List_of_U.S._states_and_territories_by_life_expectancy
• Median Age http://www.statemaster.com/graph/peo_med_age-people-median-age
• Land area https://statesymbolsusa.org/symbol-official-item/national-us/uncategorized/states-size
• Mean elevation https://www.census.gov/library/publications/2011/compendia/statab/131ed/geography-environment.html
• Electricity price https://www.chooseenergy.com/electricity-rates-by-state/
• Gasoline price https://gasprices.aaa.com/state-gas-price-averages/
• GDP https://www.bea.gov/data/gdp/gdp-state
• Sunlight North America Land Data Assimilation System (NLDAS) Daily Sunlight (insolation) for years 1979-2011 on CDC WONDER Online Database, released 2013. Accessed at http://wonder.cdc.gov/NASA-INSOLAR.html on Jun 14, 2019 1:37:15 PM
• Births United States Department of Health and Human Services (US DHHS), Centers for Disease Control and Prevention (CDC), National Center for Health Statistics (NCHS), Division of Vital Statistics, Natality public-use data 2007-2017, on CDC WONDER Online Database, October 2018. Accessed at http://wonder.cdc.gov/natality-current.html on Jun 14, 2019 1:53:58 PM
• Precipitation North America Land Data Assimilation System (NLDAS) Daily Precipitation for years 1979-2011 on CDC WONDER Online Database, released 2013. Accessed at http://wonder.cdc.gov/NASA-Precipitation.html on Jun 26, 2019 3:30:40 PM
• Temperature http://www.usa.com/rank/us–average-temperature–state-rank.htm

The map was created with the help of the open source leaflet javascript mapping library

### Visualizing The Growth of Atmospheric CO2 Concentration

Posted In: Environment

The current CO2 concentration in the atmosphere is over 400 parts per million (ppm). This has grown about 46% since pre-industrial levels (~280 ppm) in the early 1800s. The growing concentration of CO2 is a big concern because it is the most prevalent greenhouse gas, which is increasing the temperature of the planet and leading to substantial changes in the Earth’s climate patterns.

This graph visualizes the growth in CO2 concentration in the atmosphere (mainly from CO2 emissions due to human activities, such as burning fossil fuels for energy production, deforestation and other industrial processes). The graph starts at 1980 when CO2 concentration in the atmosphere was around 340ppm. It has grown significantly since then.

One of the interesting aspects of CO2 concentration is that it is not identical all around the globe, as it takes awhile for the atmosphere to mix. The graph shows geographic differences in CO2 concentration as well as seasonal ups and downs, that underly an overall growing trend in annual average (mean) concentration.

Seasonal trends in CO2 concentration occur due to differences in the amount of plant growth across different months. Spring and summer plant growth in the northern hemisphere causes a significant amount of photosynthesis, and CO2 absorption, relative to the fall and winter. This plant growth causes a very large amount of CO2 to be absorbed by plants and a noticeable reduction in the amount of CO2 in the atmosphere. The southern hemisphere spring and summer (northern hemisphere fall and winter) aren’t as obvious because there is much less land in the southern hemisphere and the land that is there is close to the tropics and green all year round.

CO2 concentration can change by about 4-5 ppm due to the “breathing” of plants, which is pretty significant. The total weight of CO2 in the atmosphere is about 3 trillion tonnes of CO2, so 4-5 ppm is about 1% of this or 30 billion tons of CO2 removed by plant life each spring/summer.

Data and Tools:

Data comes from the US National Oceanic and Atmospheric Administration (NOAA). Data was downloaded using an automated python script and the graphs were made using javascript and the open-sourced Plot.ly javascript engine.

### Sizing the States Based On Electoral Votes

Posted In: Maps | Voting

#### Electoral Vote maps give more visual power to states with large areas but few electoral votes

This map shows the electoral outcome of the 2016 US Presidential Election and is color coded red if the state was won by Donald Trump (R) and blue if the state was won by Hilary Clinton. When looking at the map, red states tend to be larger in area than blue states, but also generally have lower populations. This gives a misleading impression that the electoral share is “redder” than it actually is. For 2016, we can see that Trump won 306 electoral votes or (57% of the total electoral votes), but the map is shaded such that 73% of the area of the US is colored red. Similarly, Clinton won 232 electoral votes, but the map is shaded such that only 27% of the map is colored blue.

The map shrinks the states with low electoral votes relative to its area and increases the size of states with large numbers of electoral votes relative to its area. On average blue states grow as they are under-represented visually, while red states tend to shrink quite a bit because they are over-represented visually. Alaska is the state that shrinks the most and DC and New Jersey are the areas that grow the most in the new map.

I think this gives a more accurate picture of how the states voted because it also gives a sense of the relative weight of those states votes. Even with the change in sizes, the map is still mostly red, but gives a better sense of how close the electoral vote totals are.

Data and Tools:
Data on electoral votes is from Wikipedia. The map was made using the leaflet open source mapping library. Data was compiled and calculations on resizing states were made using javascript.

### Assembling the World Country-By-Country

Posted In: Maps

#### Watch the world assemble country-by-country based on a specific statistic

This map lets you watch as the world is built-up one country at a time. This can be done along the following statistical dimensions:

• Country name
• Population – from United Nations (2017)
• GDP – from United Nations (2017)
• GDP per capita
• GDP per area
• Land Area – from CIA factbook (2016)
• Population density
• Life expectancy – from World Health Organization (2015)
• or a random order

These statistics can be sorted from small to large or vice versa to get a view of the globe and its constituent countries in a unique and interesting way. It’s a bit hypnotic to watch as the countries appear and add to the world one by one.

You can use this map to display all the countries that have higher life expectancy than the United States:
select “Life expectancy”, sort from “high to low” and use the scroll bar to move to the United States and you’ll get a picture like this:

or this map to display all the countries that have higher population density than the United States:
select “Population density, sort from “high to low” and use the scroll bar to move to the United States and you’ll get a picture like this:

I hope you enjoy exploring the countries of the world through this data viz tool. And if you have ideas for other statistics to add, I will try to do so.

Data and tools: Data was downloaded primarily from Wikipedia: Life expectancy from World Health Organization (2015) | GDP from United Nations (2017) | Population from United Nations (2017) | Land Area from CIA factbook (2016)
The map was created with the help of the open source leaflet javascript mapping library

### World Population Distribution by Latitude and Longitude

Posted In: Maps

tt

#### How is population distributed by latitude and longitude

This interactive map shows how population is distributed by latitude or longitude. It animates the creation of a bar graph by shifting population from its location on the map to aggregate population levels by latitude or longitude increments. Each “block” of the bar graph represents 1 million people. Population is highest in the northern hemisphere at 25-26 degrees North latitude and 77-78 degrees East Longitude.

#### Instructions:

It should be relatively explanatory. Press the “Aggregate Population by Latitude” button to make a plot of population by line of latitude (i.e. rows of the map).
Press the “Aggregate Population by Longitude” button to make a plot of population by line of longitude (i.e. columns of the map). To see the population distributed across the map, press the “Show Population Grid” button.

This map was inspired by some mapping work done by neilrkaye on twitter and reddit.

Data Sources and Tools:
This map projection is an equirectangular projection. Data on population density comes from NASA’s Socioeconomic Data and Applications Center (SEDAC) site and is displayed at the 1 degree resolution. This interactive visualization is made using the awesome leaflet.js javascript library.

### Scaling the physical size of States in the US to reflect population size (animation)

Posted In: Maps
##### States sized to New Jersey’s population density

Choropleth maps are a pretty useful kind of map that colors distinct areas of the map (e.g. states, counties or countries) to reflect different numerical or categorical values. It is useful to show differences across geographic regions. I’ve been making a bunch of these recently (stressed states, bitcoin electricity consumption, college admissions). One of the issues that can be problematic with these maps is that some regions can be very large but only have very few people. If the choropleth map is tracking a intensity value (like CO2 emissions per capita), a large area with a high color value might visually indicate that total emissions (emissions per capita x # of people) is also high. In the US this is reflected in states like Alaska, Montana and Wyoming, which are large but have very few people.

I decided to make a modified choropleth map (updated after learning that it’s called a cartogram) that scales the size of the states to be the proportional to the state’s population. States with larger populations show up as larger. This is equivalent to making each state have the same population density. Since New Jersey has the highest population density of any state in the US (1200 people/square mile), it stays the same size in this map and all the other states shrink, to reflect their lower population density. For example, California has a larger population than NJ (4.4x), but its physical size is about 20x larger. So California is shrunk to about 20% its original size to make its physical size 4.4x the size of NJ.

The states are also colored to show population as well (darker redder colors reflect larger population while yellow/beige reflects small populations).

##### States sized to California’s population density

Living in California, I decided to make another animation, this time with scaled to the density of California, so some states that are less dense will shrink, while others that are denser will grow. New Jersey grows quite a bit. Because many of the dense Northeast states grow a bit, I had to space them out (manually) so you could still see them otherwise they’d overlap too much.

Data Sources and Tools:
2015 population and population density data comes from Wikipedia and leaflet.js open source mapping library was used to create the maps. State outlines in geoJSON format come from leaflet. Javascript code was used to scale the coordinates of the geoJSON polygons to the appropriate size and animate the map.