Python RandomCharts Visualisations

Europe’s Dependance on Russian Gas

The chart of this week combines stacked bars whit a classical scatter plot by using of a secondary y-axis. It illustrates the historical composition of Gas supply to the European Union and the United Kingdom. Data comes from the International Energy Agency.

With the exception of the decrease in 2014 (the year of the annexation of Crimea and Sevastopol) gas consumption in the EU and UK area has remained broadly flat in aggregate over the last two decades. However, domestic production has decreased consistently. The resulting deficit has been filled by Russian gas supply which increased from 25% of the region’s total gas demand in 2009 to 32% in 2021.

However, not all the countries have the same level of exposure. Some northern and eastern European countries depend on Russian supply, and often on a single supply route, for 80-100 % of their natural gas imports as we can see in the right chart featured by The Economist.

However, to asses dependance one should also take into account other sources of energy. Take Austria and Finland for example. Both countries gas comes fully from Russia. Nevertheless, Finland energy from gas represents only 3% of its total consumption — thanks to large shares of nuclear, hydro and bioenergy — compared with 19% for Austria.

There is no doubt that the recent events in Ukraine have highlighted the importance for the EU and UK to diversify its energy sources. In particular, to reduce its dependency on Russia’s oil, natural gas, and coal. As it is, European countries that are highly dependent on Russian gas imports are subject to political pressure and to higher gas prices – particularly if they import via Ukraine. On the other hand, dependence is a two-way avenue and Russia is also exposed as it depends on European countries buying its gas.

Python Code

Python modules required pandas and plotly.

# Author: @Quant_Girl
# Title: Europe's Dependance on Russian Gas
# Type: Stacked Bars + Scatter
# Data Source: IEA (

import pandas as pd
import as px

dta = pd.DataFrame({
    'Year': ['2001', '2009', '2014', '2019', '2021'],
    'Domestic Production': [249, 187, 143, 99, 82],
    'Russian Gas Supply': [120, 124, 118, 175, 158],
    'Other Gas Supply': [101, 176, 144, 201, 249],
    'Share of Russian Supply': [26, 25, 29, 37, 32]})

fig =, x='Year', y=['Domestic Production', 'Russian Gas Supply', 'Other Gas Supply'],
           title= 'Share of Russia in European Union and United Kingdom Gas Demand, 2001-2021')

fig.add_trace(go.Scatter(x=dta.Year, y=dta['Share of Russian Supply'], name='Share of Russian Supply',
                         marker=dict(color="#f1c21b", size=8, line=dict(color='black', width=1.5)),
                         hovertemplate='Share of Russian supply: %{y:.0f}%<extra></extra>',