Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -51,17 +51,17 @@ def plot_graphs(data):
|
|
51 |
st.write("Explore key insights through visualizations.")
|
52 |
|
53 |
# Histogram for depression
|
54 |
-
st.markdown("#### Histogram of
|
55 |
-
fig, ax = plt.subplots(figsize=(
|
56 |
-
ax.hist(data['
|
57 |
-
ax.set_title("Histogram of
|
58 |
-
ax.set_xlabel("
|
59 |
ax.set_ylabel("Frequency")
|
60 |
st.pyplot(fig)
|
61 |
|
62 |
# Scatter plot for anxiety vs. depression
|
63 |
st.markdown("#### Scatter Plot: Anxiety vs Depression")
|
64 |
-
fig, ax = plt.subplots(figsize=(
|
65 |
sns.scatterplot(x=data['anxiety_level'], y=data['depression'], ax=ax, color='blue')
|
66 |
ax.set_title("Anxiety Level vs Depression")
|
67 |
ax.set_xlabel("Anxiety Level")
|
@@ -70,7 +70,7 @@ def plot_graphs(data):
|
|
70 |
|
71 |
# Correlation heatmap
|
72 |
st.markdown("#### Correlation Heatmap")
|
73 |
-
fig, ax = plt.subplots(figsize=(
|
74 |
sns.heatmap(data.corr(), annot=True, cmap="coolwarm", ax=ax)
|
75 |
ax.set_title("Correlation Heatmap")
|
76 |
st.pyplot(fig)
|
|
|
51 |
st.write("Explore key insights through visualizations.")
|
52 |
|
53 |
# Histogram for depression
|
54 |
+
st.markdown("#### Histogram of Stress Levels")
|
55 |
+
fig, ax = plt.subplots(figsize=(4, 2))
|
56 |
+
ax.hist(data['stress_level'], bins=20, color='skyblue', edgecolor='black')
|
57 |
+
ax.set_title("Histogram of Stress Levels")
|
58 |
+
ax.set_xlabel("Stress Level")
|
59 |
ax.set_ylabel("Frequency")
|
60 |
st.pyplot(fig)
|
61 |
|
62 |
# Scatter plot for anxiety vs. depression
|
63 |
st.markdown("#### Scatter Plot: Anxiety vs Depression")
|
64 |
+
fig, ax = plt.subplots(figsize=(4, 2))
|
65 |
sns.scatterplot(x=data['anxiety_level'], y=data['depression'], ax=ax, color='blue')
|
66 |
ax.set_title("Anxiety Level vs Depression")
|
67 |
ax.set_xlabel("Anxiety Level")
|
|
|
70 |
|
71 |
# Correlation heatmap
|
72 |
st.markdown("#### Correlation Heatmap")
|
73 |
+
fig, ax = plt.subplots(figsize=(8, 6))
|
74 |
sns.heatmap(data.corr(), annot=True, cmap="coolwarm", ax=ax)
|
75 |
ax.set_title("Correlation Heatmap")
|
76 |
st.pyplot(fig)
|