[英]How to shift a plot so that the label in the y-axis is not cut?
这是我担心的 python 中整个程序的一部分。 该图太大以至于 y 轴上的 label 被“裁剪”。 有什么建议么?
# ======== 3 log-log Fsq1 with error bars VS time ==============
plt.xlim([1,500])
plt.xlabel(r'$t$', fontsize=8)
plt.ylabel(r'$log F_s(q1, x(t))$', fontsize=8)
plt.xscale('log')
plt.yscale('log')
plt.errorbar(time , Fsq1, Fsq1err, color='r', label= r'Numeric', linewidth=1)
plt.plot( time , Fsq1num, 'c-',label= r'Theory', linewidth=1)
plt.legend(loc=4)
#plt.show()
pdf.savefig()
plt.close()
尝试 plt.tight_layout()
这会调整间距以避免裁剪掉图形的某些部分。 它并不完美,因此您可能想尝试使用这些参数。 查看文档
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.