Skip to content

Commit

Permalink
fix legend by changing int to float
Browse files Browse the repository at this point in the history
  • Loading branch information
ioalexei committed Nov 20, 2024
1 parent f3b4602 commit cb131f4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/create_webmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,22 +102,22 @@ def main(
gdf.gvi_score.min(),
gdf.gvi_score.max(),
(gdf.gvi_score.max() - gdf.gvi_score.min()) / 4,
dtype=int,
dtype=float,
)
)

# Generate labels by looking up what the GVI score would be for those values
legend_label_1 = round(
np.linspace(gdf.gvi_score.min(), gdf.gvi_score.max(), 100)[0]
np.linspace(gdf.gvi_score.min(), gdf.gvi_score.max(), 100)[0], 1
)
legend_label_2 = round(
np.linspace(gdf.gvi_score.min(), gdf.gvi_score.max(), 100)[33]
np.linspace(gdf.gvi_score.min(), gdf.gvi_score.max(), 100)[33], 1
)
legend_label_3 = round(
np.linspace(gdf.gvi_score.min(), gdf.gvi_score.max(), 100)[66]
np.linspace(gdf.gvi_score.min(), gdf.gvi_score.max(), 100)[66], 1
)
legend_label_4 = round(
np.linspace(gdf.gvi_score.min(), gdf.gvi_score.max(), 100)[99]
np.linspace(gdf.gvi_score.min(), gdf.gvi_score.max(), 100)[99], 1
)

# Normalise the label values to lookup against the colourmap
Expand Down

0 comments on commit cb131f4

Please sign in to comment.