matlab和python有共同点吗_仅就作图而言,python和matlab有可比性吗?

params = { 'mathtext.fontset': 'stix', 'mathtext.rm': 'serif', 'mathtext.rm': 'serif', 'font.family': 'serif', 'font.serif': "Times New Roman", 'figure.dpi': 72.0, 'xtick.direction': 'in', 'xtick.top': True, 'ytick.right': True, 'ytick.direction': 'in'}mpl.rcParams.update(params)fig, axes = plt.subplots(nrows=5, ncols=4, figsize=(10, 12), sharex=True, sharey=True)fig.subplots_adjust(hspace=0, wspace=0)year = 1995for i in np.arange(0, 5): # rows for j in np.arange(0, 4): # cols if i == 4 and j == 3: axes[i, j].remove() year += 1 print("now run the year of {0}".format(year)) subdata = md_daily[md_daily['Year'] == year] subdata['DOY'] = np.arange(1, len(subdata)+1) if year in [1996, 2000, 2004, 2008, 2012]: x = np.arange(1, 367) else: x = np.arange(1, 366) #print('Now drawing the {0} figure'.format(year)) try: axes[i, j].plot(np.array(x), np.array(subdata.loc[:, ['NEP_f']])) axes[i, j].plot(np.array(x), np.array(subdata.loc[:, ['GPP_f']])) axes[i, j].plot(np.array(x), np.array(subdata.loc[:, ['Reco']])) axes[i, j].text(0.03, 0.875, str(year), size=10, weight='bold', transform=axes[i, j].transAxes) plt.xticks(np.arange(1, 366, 60)) fig.text(0.5, 0.08, 'Day of year', ha='center') # common xlab fig.text(0.08, 0.5, 'C flux ( gC m$^{-2}$d$^{-1}$)', va='center', rotation='vertical') # common ylab fig.legend(labels=["NEP", "GPP", "Reco"], loc='upper center', bbox_to_anchor=(0.8, 0.245), frameon=False, ncol=1, borderaxespad=0, bbox_transform=fig.transFigure) except: pass# plt.tight_layout()#plt.savefig("C_flux_daily.png", bbox_inches='tight', dpi=600)plt.show()

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值