Spaces:
Sleeping
Sleeping
Update pages/EDA.py
Browse files- pages/EDA.py +4 -4
pages/EDA.py
CHANGED
|
@@ -420,14 +420,14 @@ Crop_recommendation1 = df[
|
|
| 420 |
|
| 421 |
crop_counts1 = Crop_recommendation1.value_counts()
|
| 422 |
explode = [0.1 if i == 0 else 0 for i in range(len(crop_counts1))]
|
| 423 |
-
|
| 424 |
-
# Create Pie Chart for Crops Growing in Poor Nutrient & Climate Conditions
|
| 425 |
-
fig, ax = plt.subplots(figsize=(3, 1)) # Reduced plot size
|
| 426 |
ax.pie(
|
| 427 |
crop_counts1, labels=crop_counts1.index, autopct='%1.1f%%',
|
| 428 |
startangle=140, explode=explode, colors=sns.color_palette("rainbow", len(crop_counts1)),
|
| 429 |
-
textprops={'fontsize':
|
| 430 |
)
|
|
|
|
|
|
|
| 431 |
st.pyplot(fig)
|
| 432 |
|
| 433 |
# Insights for Nutrient-Poor Crops
|
|
|
|
| 420 |
|
| 421 |
crop_counts1 = Crop_recommendation1.value_counts()
|
| 422 |
explode = [0.1 if i == 0 else 0 for i in range(len(crop_counts1))]
|
| 423 |
+
fig, ax = plt.subplots(figsize=(4, 2.5)) # **Balanced small size**
|
|
|
|
|
|
|
| 424 |
ax.pie(
|
| 425 |
crop_counts1, labels=crop_counts1.index, autopct='%1.1f%%',
|
| 426 |
startangle=140, explode=explode, colors=sns.color_palette("rainbow", len(crop_counts1)),
|
| 427 |
+
textprops={'fontsize': 6} # **Readable small font size**
|
| 428 |
)
|
| 429 |
+
ax.set_title("Proportion of Crops in Poor Nutrients & Climate", fontsize=8)
|
| 430 |
+
ax.set_aspect("equal") # **Ensures circular shape**
|
| 431 |
st.pyplot(fig)
|
| 432 |
|
| 433 |
# Insights for Nutrient-Poor Crops
|