柱状图:
fig = sns.barplot(x=Barname,y=Barval)
显示y轴值:
for p in fig.patches: height = p.get_height() print(p.get_height()) fig.text(x = p.get_x()+(p.get_width()/2), y = height+0.01,s = '{:.4f}'.format(height),ha = 'center')
显示标题:
fig.set_title("data_300/test_size=0.5")
设置X轴的字体大小和倾斜程度:
plt.xticks(rotation=30,fontsize = 8)
设置y轴的刻度大小:
plt.yticks([0.1,0.15,0.2,0.25,0.3,0.35,0.4], rotation=0, fontsize="10", va="center")
调整画布的间距:
plt.tight_layout( w_pad=3.0, h_pad=3.0)