saherPervaiz commited on
Commit
5a654db
·
verified ·
1 Parent(s): 82dc39f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
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 Depression Levels")
55
- fig, ax = plt.subplots(figsize=(6, 4))
56
- ax.hist(data['depression'], bins=20, color='skyblue', edgecolor='black')
57
- ax.set_title("Histogram of Depression Levels")
58
- ax.set_xlabel("Depression 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=(6, 4))
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=(10, 8))
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)