I am trying to create a subplot with the axis kept off but I want to include the labels. Here is my code. I read somewhere that if I do plt.axis('off')
it would even hide the labels. Is there any workaround this? Here is my code.
fig, ax = plt.subplots(3, 10, figsize=(20,7))
i = 0
for row in range(3):
for col in range(10):
if row == 0:
ax[row][col].imshow(final[i])
ax[row][col].set_title(temp_df.columns[col])
ax[row][col].tick_params(top='off', bottom='off', left='off', right='off', labelleft='on', labelbottom='off')
ax[row][col].imshow(final[i])
# ax[row][col].axis('off')
# ax[row][col].tick_params(axis='both', which='both',length=0)
if col == 0:
ax[row][col].set_ylabel(str(cols[row]))
i += 1
Snapshot of the subplot generated:
How can I generate a plot with axis kept off and have the labels in the plot?