Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,7 @@
|
|
1 |
-
pip install seaborn
|
2 |
-
|
3 |
import streamlit as st
|
4 |
import numpy as np
|
5 |
import pandas as pd
|
6 |
import matplotlib.pyplot as plt
|
7 |
-
import seaborn as sns
|
8 |
-
|
9 |
-
# Establecer el estilo de seaborn
|
10 |
-
sns.set_style("whitegrid")
|
11 |
|
12 |
st.title('App de prueba')
|
13 |
|
@@ -34,19 +28,16 @@ if T > 0:
|
|
34 |
|
35 |
st.write(f"En {int(T)} meses tendrás: $ {r_c[-1]}")
|
36 |
|
37 |
-
#
|
38 |
plt.figure(figsize=(10, 6))
|
39 |
-
plt.plot(np.arange(1, T+1), r_c, label='Retorno continuo', marker='o', linestyle='-'
|
40 |
plt.xlabel('Mes')
|
41 |
plt.ylabel('Inversión ($)')
|
42 |
plt.title('Crecimiento de la inversión a lo largo de los meses')
|
43 |
-
plt.grid(True
|
44 |
plt.legend()
|
45 |
-
plt.tight_layout()
|
46 |
st.pyplot(plt)
|
47 |
|
48 |
else:
|
49 |
st.write("Por favor, ingresa un valor de T mayor que 0.")
|
50 |
|
51 |
-
|
52 |
-
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
import numpy as np
|
3 |
import pandas as pd
|
4 |
import matplotlib.pyplot as plt
|
|
|
|
|
|
|
|
|
5 |
|
6 |
st.title('App de prueba')
|
7 |
|
|
|
28 |
|
29 |
st.write(f"En {int(T)} meses tendrás: $ {r_c[-1]}")
|
30 |
|
31 |
+
# Crear la gráfica
|
32 |
plt.figure(figsize=(10, 6))
|
33 |
+
plt.plot(np.arange(1, T+1), r_c, label='Retorno continuo', marker='o', linestyle='-')
|
34 |
plt.xlabel('Mes')
|
35 |
plt.ylabel('Inversión ($)')
|
36 |
plt.title('Crecimiento de la inversión a lo largo de los meses')
|
37 |
+
plt.grid(True)
|
38 |
plt.legend()
|
|
|
39 |
st.pyplot(plt)
|
40 |
|
41 |
else:
|
42 |
st.write("Por favor, ingresa un valor de T mayor que 0.")
|
43 |
|
|
|
|