fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(10, 5)) cax1 = ax1.imshow(data, cmap=cmap_discrete) ax1.set_title("Discrete Colormap", loc="left", fontdict={"weight": "bold"}, y=1.04) fig.colorbar(cax1, ax=ax1) cax2 = ax2.imshow(data, cmap=cmap_linear) ax2.set_title("Linear Colormap", loc="left", fontdict={"weight": "bold"}, y=1.04) fig.colorbar(cax2, ax=ax2) plt.tight_layout() plt.show()