I am creating a heat map using Folium.My data contains 3 columns one is category, lat and long. The lat-long points are categorized into 3 categories like A, B, and C. I am able to plot the heat map using folium, but I need to add the legend showing the color difference between the points.I need to mark points into 3 different colors based on the category.
I am attaching the sample code which for your reference.Any help is appreciated.
Thanks in advance!
from folium import plugins
from folium.plugins import HeatMap
from folium.plugins import MarkerCluster
import pandas as pd
map = folium.Map(location=[lat, long],zoom_start =12)
data = pd.read_csv(filename)
# List comprehension to make out list of lists
heat_data = [[row['LAT'],row['LONG'],] for index, row in data.iterrows()]
# Plot it on the map
HeatMap(heat_data).add_to(map)
# Display the map
map
map.save('C:\Temp\map2.html')