热门

最新

红包

立Flag

投票

同城

我的

发布
qq_51082388
是数学系的小孩儿
4 年前
trueqq_51082388

你要相信,青出于蓝而胜于蓝!

码友杂谈区
CSDN App 扫码分享
分享
评论
3
打赏
  • 复制链接
  • 举报
下一条:
#fig.set_facecolor((1,0,0)) 设置坐标轴的颜色,其中r、g、b取[0,1]之间的浮点数。 import numpy as np import matplotlib.pyplot as plt x = np.arange(0, 100) fig = plt.figure(figsize=(8,6),dpi=80) fig.set_facecolor((1,0,0)) ax1 = fig.add_subplot(2,2,1) ax1.plot(x, x) ax1.legend(['y=x']) ax2 = fig.add_subplot(2,2,2) ax2.plot(x, -x,'r') ; ax2.legend(['y=-x']) ax3 = fig.add_subplot(2,2,3) ax3.plot(x, x ** 2,'b') ax3.legend(['y=x*x']) ax4 = fig.add_subplot(2,2,4) ax4.plot(x, np.log(x),'g') ax4.legend(['y=log(x)'],loc='lower right') plt.show()
立即登录