Skip to content
Snippets Groups Projects
Commit 69ea38fc authored by Laura Marcela Becerra's avatar Laura Marcela Becerra
Browse files

Modificacion modulo cambio climatico

parent bcfbf060
No related branches found
No related tags found
No related merge requests found
......@@ -121,10 +121,143 @@ fig.show()
<center><iframe width="600" height="350" src="https://www.youtube.com/embed/LwRTw_7NNJs" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe><center>
## Aumento del nivel del mar
## Retroceso de los Glaciares
```{sidebar} Glaciares
<iframe width="450" height="280" src="https://www.youtube.com/embed/3jbMCyE3eUU" frameborder="0" allowfullscreen></iframe>
<iframe width="450" height="280" src="https://www.youtube.com/embed/ZVWXC_j7Dqs" frameborder="0" allowfullscreen></iframe>
```
Explicacion del retroceso de los glaciales
```{admonition} Glaciares colombianos
Algo sobre
```
```{code-cell}
:tags: [hide-input]
import numpy as np
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
df=pd.read_csv("./datos/state.csv")
labels = ["VOLCAN NEVADO DEL RUIZ","SIERRA NEVADA DE SANTA MARTA",
"VOLCAN NEVADO DEL TOLIMA","VOLCAN NEVADO DEL HUILA",
"VOLCAN NEVADO DEL SANTA ISABEL","SIERRA NEVADA DE EL COCUY"]
NN=len(labels)
perc = np.zeros(NN)
i=0
for c in labels:
df3 = df[df["NAME"]== c ]
df4 = df3[ df3["YEAR"]==df3["YEAR"].min()]
df5 = df3[ df3["YEAR"]==df3["YEAR"].max()]
perc[i] =(df4.iloc[0]["AREA"] - df5.iloc[0]["AREA"])*100/df4.iloc[0]["AREA"]
i+=1
labels2 = ["N. del Ruiz","S.N. de Santan Marta ",
"N. del Tolima","N. del Huila",
"N. de Santa Isabel ","S.N. del Cocuy"]
data = {'Name':labels2,
'Perc': perc}
dff1 = pd.DataFrame(data)
dff = dff1.sort_values('Perc', ascending=True)
fig = px.bar(dff, x="Perc", y="Name",title='<b>Perdida de Área entre [ 1850-2000 ] </b>',
template='simple_white', width=450, height=450, text=["{:.2f}%".format(i) for i in dff['Perc']],
labels={
"Perc": " ",
"Name": " "})
fig.update_traces(marker_color='#3EB595')
fig.update_layout(uniformtext_minsize=8, uniformtext_mode='hide', autosize=False, title_x=0.7, title_font_family ="Calibri")
fig.show()
```
## Aumento del nivel del mar
```{code-cell}
:tags: [hide-input]
import pandas as pd
import plotly.graph_objs as go
df = pd.read_csv(r'http://www3.epa.gov/climatechange/images/indicator_downloads/sea-level_fig-1.csv',skiprows=6)
inchmm=25.4
upper_bound = go.Scatter(
name='+',
x=df['Year'],
y=df['CSIRO - Upper error bound (inches)']*inchmm,
mode='lines',
line=dict(width=0.5,
color="rgb(255, 188, 0)"),
fillcolor='rgba(68, 68, 68, 0.1)',
fill='tonexty',
showlegend=False )
trace1 = go.Scatter(
name='cambio',
x=df['Year'],
y=df['CSIRO - Adjusted sea level (inches)']*inchmm,
mode='lines',
line=dict(color='rgb(31, 119, 180)'),
fillcolor='rgba(68, 68, 68, 0.1)',
fill='tonexty',
showlegend=False )
lower_bound = go.Scatter(
name='-',
x=df['Year'],
y=df['CSIRO - Lower error bound (inches)']*inchmm,
mode='lines',
line=dict(width=0.5, color="rgb(141, 196, 26)"),
showlegend=False)
data = [lower_bound, upper_bound, trace1]
layout = go.Layout(
yaxis=dict(title='Variación global del nivel del mar [mm]',
showline=True,
linecolor='black',
gridcolor='lightgrey',
mirror=True),
#title='Volatility Visualization',
xaxis=dict(title='Año', showline=True,
linecolor='black',
gridcolor='lightgrey',
mirror=True ,
rangeslider=dict(
visible = True,
),
type='date'
),
showlegend = True,
width=750,
height=500,
margin=dict(
l=50,r=50,b=50,t=50,pad=4),
font=dict(
family="Rockwell",
size=15),
plot_bgcolor='rgba(0,0,0,0)')
fig = go.Figure(data=data, layout=layout)
fig.show()
````
```{admonition} Para saber más....
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment