forked from EdPPF/APC-Parte01
-
Notifications
You must be signed in to change notification settings - Fork 0
/
co2_variacao_setores.py
49 lines (38 loc) · 1.33 KB
/
co2_variacao_setores.py
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
49
# -*- coding: utf-8 -*-
"""CO2_VARIACAO_SETORES
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1xeGunE0NX8I44VRRZdsGJeWsFCXOadLf
"""
!pip install plotly
import plotly
import pandas as pd
import plotly.graph_objects as go
Ano = []
Energia = []
Pi = []
Agricultura = []
Solo = []
impdata = pd.read_csv('https://raw.githubusercontent.com/EdPPF/APC-Parte01/main/co2_variacao_setores.csv')
dados = impdata.values
for i in dados:
Ano.append(i[0])
Energia.append(i[1])
Pi.append(i[2])
Agricultura.append(i[3])
Solo.append(i[4])
trace1 = go.Scatter(x=Ano, y= Energia, mode = 'lines+markers', name = 'Energia')
trace2 = go.Scatter(x = Ano, y = Pi, mode = 'lines+markers', name = 'Processos Industriais')
trace3 = go.Scatter(x = Ano, y = Agricultura,mode = 'lines+markers', name = 'Agricultura')
trace4 = go.Scatter(x = Ano, y = Solo, mode = 'lines+markers', name = 'Solo e Silvicultura')
data = [trace1,trace2,trace3,trace4]
layout=go.Layout(
hovermode="x",
title='VARIAÇÃO DA EMISSÃO DE CO2 POR SETORES - BRASIL',
xaxis_title='Anos',
yaxis_title='Variação (%)',
plot_bgcolor = 'black',
font = {'family': 'Arial','size': 16,'color': 'black'} #family = fonte)
)
graflinha = go.Figure(data=data, layout=layout)
graflinha.show()