Plotting a horizontal line on multiple subplots in python using pyplot
问题 I am plotting three subplots on the same page. I want to draw a horiZontal line through all the subplots. Following is my code and the resultant graph: (You can notice I can get the horizontal line on one of the plots, but not all) gs1 = gridspec.GridSpec(8, 2) gs1.update(left=0.12, right=.94, wspace=0.12) ax1 = plt.subplot(gs1[0:2, :]) ax2 = plt.subplot(gs1[3:5, :], sharey=ax1) ax3 = plt.subplot(gs1[6:8, :], sharey=ax1) ax1.scatter(theta_cord, density, c = 'r', marker= '1') ax2.scatter(phi