Code: Select all
fig, ax = plt.subplots(
1,
4,
figsize=[18, 4],
sharex=True,
sharey=True,
)
for i in range(4):
ax[i].imshow(np.random.rand(200, 800), cmap="viridis_r", origin="lower")
divider = make_axes_locatable(ax[-1])
cax = divider.new_horizontal(size="4%", pad="2%")
fig.add_axes(cax)
fig.colorbar(mpl.cm.ScalarMappable(cmap=mpl.cm.viridis_r, norm=norm), cax=cax)
plt.show()
Warum hat hier die ColorBar eine weitere x -Achse mit sehr dichten Zecken? Ich will sie nicht! < /P>
Code: Select all
cax.set_xticks([])