Update app.py
Browse files
app.py
CHANGED
@@ -544,7 +544,7 @@ if "result" in st.session_state:
|
|
544 |
bins=[-1, 0, 0.1, 0.2, 0.3, 0.4, 0.5, 1]
|
545 |
histogram, bin_edges = get_histogram(mosaic.select(veg_index), ee_geometry, bins)
|
546 |
total_pix = np.sum(histogram)
|
547 |
-
formatted_histogram = [f"{h/total_pix:.2f}" for h in histogram]
|
548 |
print(histogram, bin_edges, bins, formatted_histogram)
|
549 |
m.add_legend(title="NDVI Class/Value",
|
550 |
legend_dict={'<0:Waterbody {}%'.format(formatted_histogram[0]): '#0000FF',
|
|
|
544 |
bins=[-1, 0, 0.1, 0.2, 0.3, 0.4, 0.5, 1]
|
545 |
histogram, bin_edges = get_histogram(mosaic.select(veg_index), ee_geometry, bins)
|
546 |
total_pix = np.sum(histogram)
|
547 |
+
formatted_histogram = [f"{h*100/total_pix:.2f}" for h in histogram]
|
548 |
print(histogram, bin_edges, bins, formatted_histogram)
|
549 |
m.add_legend(title="NDVI Class/Value",
|
550 |
legend_dict={'<0:Waterbody {}%'.format(formatted_histogram[0]): '#0000FF',
|