I want to plot two tematic maps side by side to compare then. I am using geopandas to plot the maps and pysal to generate the maps from spatial analysis.
How to plot two maps side by side using pysal or geopandas?
4.4k views Asked by Oalvinegro At
3
There are 3 answers
0
On
import folium
import folium.plugins
m = folium.plugins.DualMap(location=(52.1, 5.1), tiles='cartodbpositron', zoom_start=8)
fg_both = folium.FeatureGroup(name='markers_both').add_to(m)
fg_1 = folium.FeatureGroup(name='markers_1').add_to(m.m1)
fg_2 = folium.FeatureGroup(name='markers_2').add_to(m.m2)
icon_red = folium.Icon(color='red')
folium.Marker((52.0, 5.0), tooltip='both', icon=icon_red).add_to(fg_both)
folium.Marker((52.4, 5.0), tooltip='1').add_to(fg_1)
folium.Marker((52.0, 5.4), tooltip='2').add_to(fg_2)
folium.LayerControl(collapsed=False).add_to(m)
m
#output
You can create the subplots structure with matplotlib, and then add the plots with geopandas/pysal to the specific subplot: