Welcome to sulfur dioxide air pollution!

Cumbrevieja is a volcano located in La Palma island. It's an active volcano producing sulfur dioxide gases in the atmosphere.

The weekend 25 to 26 of september 2021 air pollution from the volcano arrived to catalonia as you can see in the following graph

The graph was created using matplotlib library in Python and the code is below

Data are obtained from the air pollution website of Generalitat de Catalunya


  # it makes accesible all the instructions and codes contained in matplotlib in order to create graphs
import matplotlib.pyplot as plt

  # x data is 48 hours data obtained from generalitat data base corresponding to SO2 in the weekend of interest
x = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48]

  # y data are SO2 levels hour by hour in the three cities indicated in labels
y = [ [1,1,1,1,1,1,1,1,1,1,1,1,1,3,3,1,1,1,1,1,2,5,5,5,5,4,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
      [5,5,5,5,6,5,5,6,5,5,5,5,5,5,5,5,5,5,5,5,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],
      [2,2,2,3,1,1,1,1,1,1,1,7,23,23,36,37,37,31,23,11,3,2,1,1,2,2,2,2,1,1,1,2,1,2,4,6,4,2,1,1,1,1,1,1,2,4,4,4] ]
labels=['igualada', 'gavĂ ', 'berga']

  # color of the three cities are r=red, g=green, b=blue
colors=['r','g','b']

# loop over data, labels and colors
for i in range(len(y)):
    plt.plot(x,y[i],'o-',color=colors[i],label=labels[i])
plt.title("AIR SULFUR DIOXIDE IN CATALONIA FROM THE VOLCANO", loc='left')
plt.xlabel("Hours of weekend 25-26/09/2021")
plt.ylabel("SO2 microgram/m3")
plt.legend()
plt.show()
  
  • To learn more about HTML, CSS and Javascript, check out these tutorials and www.w3schools.com!