I want that all the three subplots have a common horizontal line keeping the distance between the subplots unchanged. Basically I just want to fill the spaces between three horizontal lines to create one large horizontal line. How can this be done?
Here is the figure
Here is the code
import numpy as np
import matplotlib.pyplot as plt
x_axis=['HE','BBHE','BHEPL','DOTHE','RSIHE','QDHE','RSWHE']
y_drive=[0.480,0.478,0.638,0.508,0.475,0.587,0.846]
y_stare=[0.759,0.766,0.856,0.659,0.777,0.767,0.865]
y_chase=[0.482,0.515,0.809,0.763,0.520,0.802,0.802]
x=np.array(np.arange(0,1.30,0.2))
x=np.arange(0,7)
width=1
fig,(ax1,ax2,ax3)=plt.subplots(1,3,sharey=True,sharex=True) #returns subplot axes or object
ax1.bar(x,y_drive,width,color=['r','g','b','c','m','y','k'],alpha=0.80)
ax1.spines['top'].set_visible(False)
ax1.spines['right'].set_visible(False)
ax1.tick_params(axis='both',which='both',bottom=False,left=False,labelbottom=False)
ax1.set_xlabel('DRIVE')
ax1.set_ylim(0,1)
ax2.bar(x,y_stare,width,color=['r','g','b','c','m','y','k'],alpha=0.80)
ax2.spines['top'].set_visible(False)
ax2.spines['left'].set_visible(False)
ax2.spines['right'].set_visible(False)
ax2.tick_params(axis='both',which='both',bottom=False,left=False,labelbottom=False)
ax2.set_xlabel('STARE')
ax3.bar(x,y_chase,width,color=['r','g','b','c','m','y','k'],alpha=0.80)
ax3.spines['top'].set_visible(False)
ax3.spines['left'].set_visible(False)
ax3.spines['right'].set_visible(False)
ax3.tick_params(axis='both',which='both',bottom=False,left=False,labelbottom=False)
ax3.set_xlabel('CHASE')
plt.show()