折线图
from matplotlib import pyplot as plt
factor_number=range(10,60,10)
fiber_0D=[9326,9390,9314,9154,9017]
fiber_4D=[9310,9184,9060,8914,8722]
fiber_8D=[9833,9805,9608,9403,9177]
fiber_12D=[9360,9241,9060,8937,8808]
fiber_16D=[8356,8327,8191,8095,7906]
fiber_20D=[7992,7907,7759,7659,7449]
fig = plt.figure(dpi=600)
## 设置label,方便输出图例
fig0D=plt.plot(factor_number, fiber_0D,label='0DPA (370)')
fig4D=plt.plot(factor_number, fiber_4D,label='4DPA (362)')
fig8D=plt.plot(factor_number, fiber_8D,label='8DPA (372)')
fig12D=plt.plot(factor_number, fiber_12D,label='12DPA (371)')
fig16D=plt.plot(factor_number, fiber_16D,label='16DPA (371)')
fig20D=plt.plot(factor_number, fiber_20D,label='20DPA (369)')
#! set x ticks
plt.xticks(factor_number)
#! set labs
plt.xlabel('PEER factors', size=14)
plt.ylabel('eGenes', size=14)
#! set location of legends
plt.legend(loc=(1.1,0.5))
plt.show()
Last updated