Programming/Python

Python 선 그래프 그리기

빠릿베짱이 2013. 5. 15. 11:15
반응형

import matplotlib.pyplot as plt
import matplotlib.legend as legend
index=[0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 0]

#GABDR=[0.86, 1, 0.98, 0.98, 0.99, 0.98, 0.99, 1]
GABDR=[0, 0.51, 0.37, 0.87, 0.41, 0.33, 0.56, 0.65]
gab,=plt.plot(index, GABDR, 'ro-')
#plt.plot(index, GABFPR, 'ro-')

#RABDR=[0.94, 0.99, 0.99, 0.97, 0.99, 0.96, 0.90, 1]
RABDR=[0.06, 0.39, 0.53, 0.43, 0.29, 0.42, 0.41, 0.34]
rab,=plt.plot(index, RABDR, 'g^-')
#plt.plot(index, RABFPR, 'r^-')

#DABDR=[0.93, 0.99, 0.99, 1, 1, 0.98, 0.99, 1]
DABDR=[0.39, 0.84, 0.82, 0.84, 0.90, 0.54, 0.62, 0.66]
dab,=plt.plot(index, DABDR, 'bs-')
#plt.plot(index, RABFPR, 'r^-')

plt.legend([dab, rab, gab],['DAB','RAB','RAB'], loc=3)
plt.xlabel('FPR of Stage')
plt.ylabel('False Positive Rate')
plt.axis([-0.05,0.75, 0.0, 1.05])
plt.grid(True)
plt.show()
반응형