This is a follow on from my Previous Question
I have the following code:
#Plot
cmap = plt.cm.GnBu_r
f, ax = plt.subplots(nrows=4,figsize=(20,10))
spec = f.add_gridspec(ncols = 1, nrows = 4, height_ratios = [1,1,1,.3])
ax0 = f.add_subplot(spec[0])
ax0 = sns.heatmap(df1,cbar=False,cmap=cmap)
ax1 = f.add_subplot(spec[1])
ax1 = sns.heatmap(df2,cbar=False,cmap=cmap)
ax2 = f.add_subplot(spec[2])
ax2 = sns.heatmap(df3,cbar=False,cmap=cmap)
ax3 = f.add_subplot(spec[3])
ax3 = sns.heatmap(df4,cbar=False,cmap=cmap)
axis = [ax0,ax1,ax2,ax3]
names = ['1', '2', '3','4']
for axi in axis:
n = axis.index(axi)
axi.set_title(str(names[n]))
axi.set(xticklabels=[])
axi.set_xlabel('')
axi.xaxis.set_visible(False)
h = axi.get_yticks()
w = axi.get_xticks()
axi.vlines(25, h[0] - 0.5, h[-1] + .5, linewidth=1, color="black")
axi.vlines(50,h[0]-0.5,h[-1]+.5, linewidth=1, color="black")
axi.vlines(75,h[0]-0.5,h[-1]+.5, linewidth=1, color="black")
axi.vlines(100,h[0]-0.5,h[-1]+.5, linewidth=2, color="black")
axi.set_ylabel('')
Which gives me the following output:
I have blacked out the names that I want to show but I am wondering how to hide the other x and y labels? eg all the decimals. I think they are related to the gridspec boxes for the 4 indivdual plots but i dont know how to remove them. I can remove the xticklabels
and xlabel
but it doesnt seem to work on the decimal points.
Summary Question: How do I remove the decimal points in the plots? Any help would be much appreciated! Thanks!