plt设置横纵坐标名称

#设置横纵坐标的名称以及对应字体格式
font2 = {'family' : 'Times New Roman',
    'weight' : 'normal',
    'size' : 15
    }
plt.xlabel('Year',font2)
plt.ylabel('Citations',font2)
fig = plt.figure(figsize=(20, 12), dpi=80)

# 设置坐标轴刻度
y = range(0,400,50)

plt.plot(table[2][:116], 'ro-', label='Einstein. Albert; 1905')
plt.yticks(y)
plt.legend()

#设置横纵坐标的名称以及对应字体格式
font2 = {'family' : 'Times New Roman',
    'weight' : 'normal',
    'size' : 15
    }
plt.xlabel('Distance to the publication year',font2)
plt.ylabel('Citations',font2)

plt.show()
原文地址:https://www.cnblogs.com/Cookie-Jing/p/15505394.html