Reputation: 161
Idea is to plot in layers having a base map(r5_base) and then overlay by gpd a 'regionbybranch'.
As can be seen from images below, two figures were created but I am expecting only one. The desired map was plot correctly with the second figure but it did not follow the desired 'figsize'
# Isolate Region on map
r5_base = bars[bars.Reg_Name=='REGION V (BICOL REGION)']
# Isolate region from OP data
region=mpabars_gdf[mpabars_gdf.RegionName=='Bicol Region']
# Plot area.
regionbybranch = region.dissolve(by='BranchName', aggfunc='sum',as_index=False)
fig, ax = plt.subplots(1,1,sharex=True, sharey= True, figsize=(30,30))
base = r5_base.plot(color='gray')
regionbybranch.plot(ax=base, linewidth=0.5, edgecolor='black', legend= False, column='Penetration',cmap='viridis')
# plt.title('Market Penetration on Bicol Region');
# fig.savefig(“map_export.png”, dpi=300)
Upvotes: 0
Views: 204
Reputation: 1130
I think you have to set the proper axes name when you call the plot function. Something like this should work:
fig, ax = plt.subplots(1,1,sharex=True, sharey= True, figsize=(30,30))
base = r5_base.plot(ax=ax,color='gray')
regionbybranch.plot(ax=ax, linewidth=0.5, edgecolor='black',
legend= False, column='Penetration',cmap='viridis')
Upvotes: 1