import matplotlib.pyplot as plt
#折线图
x=[1,2,3,4,5,6,7,8,9]
x_index = [1,2,5,10,100,300,500,700,900]#点的横坐标
k1 = [0.7961,0.7985,0.8045,0.8052,0.8061,0.8072,0.8083,0.8065,0.8051]#线1的纵坐标
k2 = [0.4551,0.4540,0.4485,0.4477,0.4460,0.4445,0.4435,0.4465,0.4485]#线2的纵坐标
fig, ax1 = plt.subplots()
_ = plt.xticks(x,x_index)
ax1.plot(x,k1,'s-',color = 'r',label="AUC")
ax1.set_xlabel("number of ")
ax1.set_ylabel("AUC")
ax2 = ax1.twinx()
ax2.plot(x,k2,'o-',color = 'g',label="Logloss")
ax2.set_ylabel("Logloss")
handles1, labels1 = ax1.get_legend_handles_labels()
handles2, labels2 = ax2.get_legend_handles_labels()
plt.legend(handles1+handles2, labels1+labels2, loc='best')
plt.show()
示意图: