Reputation: 271
I have attempted to move my yticks on the heat map below to the centre of the row it corresponds to.
This has worked, except for the fact I now get the white space at the bottom of the graph. Is there a way to achieve the ticks in the middle without the white space?
Original image & code:
heatmap = plt.pcolor(df2.T, cmap=cmap, vmax=1, vmin=0)
plt.yticks(range(len(df2.columns )+1), o, size=15)
New Image & Code
heatmap = plt.pcolor(df2.T, cmap=cmap, vmax=1, vmin=0)
plt.yticks(np.arange(0.5, len(df2.columns)+1,1), df2.columns, size=15)
Attempts
I have tried using
plt.yticks(np.arange(0.5, len(df2.columns)+0.5,1), o, size=15
Note the change from +1 to +0.5 This however, halves my bottom row. See below:
Upvotes: 1
Views: 344