得到了图表的这个函数,想要格式化轴,使图表从(0,0)开始,我如何写图例,这样我就可以标记哪条线属于 y1,哪条线属于 y2 和标签轴。
import matplotlib.pyplot as plt
def graph_cust(cust_type):
"""function produces a graph of day agaist customer number for a given customer type"""
s = show_all_states_list(cust_type)
x = list(i['day']for i in s)
y1 = list(i['custtypeA_nondp'] for i in s)
y2 = list(i['custtypeA_dp']for i in s)
plt.scatter(x,y1,color= 'k')
plt.scatter(x,y2,color='g')
plt.show()
谢谢