Here is my sample data:
aa=pd.DataFrame({'x':[2011.0,2012.0,2013.0,2014.0],
'y':[2011.0,2012.0,20113.0,2014.0],
'group':['a','b','c','d']})
fig = plt.figure()
fig.suptitle('**************************')
ax = fig.add_subplot(2,2,1)
aa1=aa.loc[(aa['group']=='a')]
p=ax.scatter(aa1.loc[:,'x'],aa1.loc[:,'y'],alpha=.7,s=3,color='blue')
ax.set_title('a')
plt.xticks(rotation=45)
ax = fig.add_subplot(2,2,2)
aa1=aa.loc[(aa['group']=='b')]
p=ax.scatter(aa1.loc[:,'x'],aa1.loc[:,'y'],alpha=.7,s=3,color='blue')
ax.set_title('b')
plt.xticks(rotation=45)
ax = fig.add_subplot(2,2,3)
aa1=aa.loc[(aa['group']=='c')]
p=ax.scatter(aa1.loc[:,'x'],aa1.loc[:,'y'],alpha=.7,s=3,color='blue')
ax.set_title('c')
plt.xticks(rotation=45)
ax = fig.add_subplot(2,2,4)
aa1=aa.loc[(aa['group']=='d')]
p=ax.scatter(aa1.loc[:,'x'],aa1.loc[:,'y'],alpha=.7,s=3,color='blue')
ax.set_title('d')
plt.xticks(rotation=45)
#plt.tight_layout()
plt.show()
If I do not use tight_layout:
If I use tight_layout:
I do not want either of them. I hope I can customize the distance between subplots (x and y) by myself.