Löschen Sie die redundante Achse in der FarbleistePython

Python-Programme
Anonymous
 Löschen Sie die redundante Achse in der Farbleiste

Post by Anonymous »

Dieser Teil des Code stammt aus dem Code meines Lehrers: < /p>

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()
ok, dieser ColorBar ist normal, aber in einem anderen Teil des Codes:

Warum hat hier die ColorBar eine weitere x -Achse mit sehr dichten Zecken? Ich will sie nicht! < /P>

Code: Select all

cax.set_xticks([])
funktioniert nicht

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post