个人而言比较喜欢python作图,常用matplotlib库,交互式的常用pyechart。说作图繁琐,那是一定的啦,毕竟要调整各种细节,tick的间隔,font 大小和类型,子图是否share 坐标,是否共用legend,是否需要标注显著性啦,用什么符号表示显著性啦,是否要在各个子图右上角标注顺序(如a, b, c)或者时间(如1991, 1992, 1993)啦,图片保存或显示类型啦(png or svg),是否都显示坐标轴啦(Nature上经常看到子图X坐标轴是间隔出现的), 还有就是tick是in 还是out啦?反正各种,经常需要循环里面加判断语句的。要画好图没这么简单的。不管matlab还是python.
#############08-08-2019 更新###########
我找了一个我之前作业画的图以及代码(本人没有用过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 = 1995
for 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()