I'm using geopandas (python 3.8.2) to plot variables contained in a geodataframe. I would like to plot on a single figure, all datasets with their own colormap. The problem is that the plot shows only the last dataset, which corresponds to 'var_5' with colormap 'Reds'. Even if I set: ax = geodataframe.plot() it does not work.
Any idea ? Many Thanks!
import geopandas as gpd
import matplotlib.pyplot as plt
filename = 'myfile.geojson'
geodataframe = gpd.read_file(filename)
cmaps = ['plasma', 'Greens', 'Blues', 'binary', 'Reds']
variables = ['var_1', 'var_2', 'var_3', 'var_4', 'var_5']
plt.rcParams['figure.figsize'] = (20, 10)
ax = plt.gca()
for i, var in enumerate(variables):
geodataframe.plot(ax=ax, column=var, cmap=cmaps[i])
plt.show()
Edit: