我已将精确数字添加到我的绘图中,但现在不适合该空间。我怎样才能解决这个问题?问题:
码:
ax = df.plot.barh(y='1960', rot=0,title='Five most populous countries and its population',color=['cyan', 'blue', 'green', 'red', 'black'])
for j, v in enumerate(list(df['1960'])):
ax.text(v, j, " "+str(round(v,2)), color='blue', va='center', fontweight='bold')
ax.set_xlabel("Population in mln")
ax.set_ylabel("")
ax.invert_yaxis()
fig = ax.get_figure()
fig.savefig('C:\\Users\\rysza\\Desktop\\python data analysis\\zajecia3\\figure'+str(i)+'.jpeg',bbox_inches='tight')
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句