I am attempting to plot overlapping vector and raster maps with following code:
fig, axes = plt.subplots(1,3, figsize=(12, 5))
plt.subplots_adjust(left=None, bottom=None, right=1.1, top=None, wspace=None, hspace=None)
norm1 = colors.BoundaryNorm([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 10)
cmap1 = 'jet'
picca_jan.plot(cmap = cmap1, norm = norm1, add_labels=False, add_colorbar = False, ax=axes[0])
sf_picca.geometry.boundary.plot(ax=axes[0], color=None, alpha = 1, edgecolor='black', linewidth = 1.0)
#axes[0,0].get_yaxis().set_visible(False)
axes[0].get_xaxis().set_visible(False)
axes[0].set_title("month = 1", fontsize=20)
im = picca_feb.plot.imshow(ax = axes[1], cmap = cmap1, norm = norm1, add_labels=False, add_colorbar = False)
sf_picca.geometry.boundary.plot(ax=axes[1], color=None, alpha = 1, edgecolor='black', linewidth = 1.0)
axes[1].get_yaxis().set_visible(False)
axes[1].get_xaxis().set_visible(False)
axes[1].set_title("month = 2", fontsize=20)
im = picca_march.plot.imshow(ax = axes[2], cmap = cmap1, norm = norm1, add_colorbar = False, add_labels=False)
sf_picca.geometry.boundary.plot(ax=axes[2], color=None, alpha = 1, edgecolor='black', linewidth = 1.0)
axes[2].get_yaxis().set_visible(False)
axes[2].get_xaxis().set_visible(False)
axes[2].set_title("month = 3", fontsize=20)
plt.tight_layout()
As it can be seen from the image, size of the second and third image doesn't match. If I remove sf_picca
shapefile, I get the figures with exactly the same size.
Can someone please explain what's going on?