Worked Examples


1. Capital deflation


The UK’s housing crisis is no state secret. It is estimated England has a backlog of 3.91 million homes and homelessness in the UK has doubled since 2010.

Prices have reached astronomical levels in London, while in some areas of the UK house prices have failed to return to pre-crisis figures. The latest data shows Northern Ireland remains 41% under below its pre-2008 level. 

This simple bar chart shows things are beginning to change. Average house prices in London fell by 0.7%, making it only region to experience negative growth.


2. Argentine Anxieties

chart (4).png

Argentina has defaulted on its sovereign debt eight times since independence in 1816, spectacularly so in 2001 on $100bn of bonds - at the time the world's largest default. This year the peso lost 40% of its value, which prompted President Macri to request a $50bn loan from the IMF, despite Argentina's poor credit history.

Here's a simple chart, but memorable chart, depicting Argentina's shocking debt problems. 

The data can be found here. And the Vega specification here.


3. Gasoline prices

chart (2).png

Americans are driving more than ever -- the country drove a total of 3.22 trillion miles in 2017. Cars are necessary in many areas of the country to get to work, school, and to conduct business. That's why a lot of Americans are highly aware of the price at the pump. That price is determined by a complex range of factors, ranging from global oil production levels to US trade policy. To see how prices have changed over time - and to see if gas just costs more in one area of the country than another - we can use a line graph with multiple lines. 

This graph shows that gas prices have been on a generally upward trend since 2016, but have dipped down since July of this year. It also shows that gas is generally cheaper in Texas compared to Miami, and tends to be the most expensive (of the three regions) in Seattle. 

The data for this chart can be found here. The Vega specification to draw this chart can be found here.


4. Scotland: Drug related deaths

chart (8).png

Scotland has the highest number of drug related deaths in Europe. In 2017 there was a record 934 drug-related deaths – 66% higher than in 2006. The biggest killer are opiates, contributing to 87% of the deaths in the previous year.


5. FIREARM Fatalities

States and guns deaths, version 1.PNG
States and guns deaths, version 2.PNG

2018 has been a year in which firearm deaths rarely out of the news in America. In the Spring The March for Our Lives, organised as a response to the killing of 17 people at Marjory Stoneman Douglas High School in Florida saw thousands raise the issue in Washington DC. Deaths due to firearms vary a lot by state. The first chart is a simple scatter, showing that in relatively high income states there are fewer firearm deaths than in those where income is lower. (Hover over the dots to see the states and the data). 

The second chart is an example of how you can use colour and sizing to add dimensions, even when you are working with a 2D plot. It clearly shows that there are more firearm deaths in the south and that the south also has a much larger prison population. The data for these charts is here, and the Vega specification to draw the charts is here and here


6. Drug overdoseS

chart (1).png

The US is in the midst of an opioid crisis -- every day, more than 115 people in the country die from overdosing on opioids. The crisis is a public health, social, and economic issue that affects the entire country. But not all parts of the country have experienced the effects of the crisis equally. We might be interested in learning if there are geographical trends in drug overdose deaths -- are certain regions, like the Midwest, affected more than others? A heat map is a great tool for answering this question. 

Hovering over any state on the map will give the state name and the exact number of drug overdose deaths in that state. The map shows that Midwestern (Ohio, Pennsylvania, etc.) and Appalachian states have experienced a high number of drug overdose deaths, as well as large states like California and Florida. 

To create a heatmap, you need a .json map file that creates the basic outline of the map, and a dataset that we use to color in the map accordingly. The map file for this graphic can be found here and the data here. The Vega specification to draw the map can be found here.